:root {
  --blue: #0619ba;
  --lime: #bae014;
  --cream: #ffefd9;
  --acid: #d3e840;
  --keyline: #896b50;
  --paper: #fffdf6;
  --ink: #14163a;
  --muted: #5b5d7a;
  --line: rgba(6, 25, 186, 0.14);
  --under: #0d0c1d;
  --bone: #f4ecd6;
  --bone-dim: rgba(244, 236, 214, 0.72);
  --spine: 170px;
  --dirt: #5e3d24; /* topsoil: where the dive lands */
  --bedrock: #140c07; /* the very bottom */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); /* the gap in the middle where the root runs */
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  /* the wallpaper brown above the page, underworld below it (shows on overscroll / very tall screens) */
  background: var(--bedrock) linear-gradient(#34150e, #34150e) no-repeat top / 100% 50vh;
}
body {
  position: relative; /* the root svg is positioned against the whole page */
  margin: 0;
  background: var(--bedrock);
  color: var(--bone);
  font: 400 17px/1.55 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}

/* ---------- header ---------- */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--blue);
  font-size: 19px;
  font-weight: 300;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.4s, opacity 0.4s;
}
.brand img {
  height: 38px;
  width: auto;
}
.brand b {
  font-weight: 800;
}
nav {
  display: flex;
  gap: 22px;
}
nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--bone);
  white-space: nowrap;
  transition: color 0.4s;
}
nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* on the full-screen logo, the small brand mark would just repeat it */
.top:not(.dark) .brand {
  opacity: 0;
  pointer-events: none;
}
/* underground */
.top.dark {
  background: rgba(28, 17, 9, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(244, 236, 214, 0.1);
}
.top.dark .brand,
.top.dark nav a {
  color: var(--bone);
}
.top.dark .brand img {
  filter: drop-shadow(0 0 5px rgba(244, 236, 214, 0.45));
}

/* ---------- the dive (hero) ---------- */
.hero {
  position: relative;
  z-index: 3; /* above the root */
  height: 340vh; /* how long the dive lasts */
}
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  /* the surface: the hand-drawn crayon earth from the lock screen wallpaper (a seamless tile) */
  background: #34150e url('/img/ground.jpg') repeat center / 402px 215px;
  display: grid;
  place-items: start center;
  /* the logo's size and place; the words, eyes and pot are laid out around it */
  --lw: min(40svh, 60vw);
  --lt: 8svh;
  --lh: calc(var(--lw) * 1.5462);
  --under: calc(var(--lt) + var(--lh) + 1.5svh); /* just below the logo */
  --s: 0.55; /* drawing scale */
}
.doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.doodles img {
  position: absolute;
  width: calc(var(--w) * var(--s) * 1px);
  max-width: none;
  height: auto;
}
.eye {
  translate: -50% -50%;
  animation: blink 7s infinite;
}
.eye.l { left: max(8vw, calc(50% - var(--lw) * 0.5 - 150px)); }
.eye.r { left: min(92vw, calc(50% + var(--lw) * 0.5 + 150px)); }
.eye.l.r2 { left: max(8vw, calc(50% - var(--lw) * 0.5 - 300px)); }
.eye.r.r2 { left: min(92vw, calc(50% + var(--lw) * 0.5 + 300px)); }
.eye.l.r1 { top: calc(var(--lt) + var(--lh) * 0.2); }
.eye.r.r1 { top: calc(var(--lt) + var(--lh) * 0.25); animation-delay: -2.2s; animation-duration: 8.5s; }
.eye.l.r2 { top: calc(var(--lt) + var(--lh) * 0.55); animation-delay: -4.1s; animation-duration: 6.3s; }
.eye.r.r2 { top: calc(var(--lt) + var(--lh) * 0.6); animation-delay: -0.7s; animation-duration: 9.1s; }
.eye.l.r3 { top: calc(var(--lt) + var(--lh) * 0.92); animation-delay: -5.5s; animation-duration: 7.7s; }
.eye.r.r3 { top: calc(var(--lt) + var(--lh) * 0.95); animation-delay: -3.3s; animation-duration: 5.9s; }
/* the outer eyes, in the open soil further out to the sides (wide screens) */
.eye.far.l { left: 15vw; }
.eye.far.r { left: 87vw; }
.eye.far.up { top: 25svh; }
.eye.far.down { top: 80svh; }
.eye.far.l.up { animation-delay: -2.9s; animation-duration: 7.2s; }
.eye.far.r.up { animation-delay: -6.1s; animation-duration: 6.4s; }
.eye.far.l.down { animation-delay: -0.4s; animation-duration: 8.8s; }
.eye.far.r.down { animation-delay: -4.7s; animation-duration: 7.9s; }
@keyframes blink {
  0%, 95%, 100% { scale: 1 1; }
  97.5% { scale: 1 0.08; }
}
.edge-eye {
  translate: 0 -50%;
  animation: blink 7s infinite;
}
/* half in, half off the screen, peeking in from the sides */
.edge-eye.l { left: 0; margin-left: calc(var(--w) * var(--s) * -0.4px); animation-delay: -1.3s; animation-duration: 6.6s; }
.edge-eye.r { right: 0; margin-right: calc(var(--w) * var(--s) * -0.4px); animation-delay: -3.9s; animation-duration: 8.1s; }
.edge-eye.r1 { top: calc(var(--lt) + var(--lh) * 0.38); }
.edge-eye.r2 { top: calc(var(--lt) + var(--lh) * 0.76); animation-duration: 7.4s; }
.edge-eye.r.r2 { animation-delay: -5.2s; }
.pot {
  left: 50%;
  translate: -50% 0;
  top: calc(var(--under) + 86px); /* under the tagline; its roots run off the bottom */
}
.logo-wrap {
  position: relative; /* above the drawings */
  width: var(--lw);
  margin-top: var(--lt);
  animation: surface 1s ease-out both;
}
.logo-wrap h1 {
  margin: 0;
}
#logo {
  width: 100%;
  height: auto;
  transform-origin: 0 0;
  will-change: transform;
}
@keyframes surface {
  from { opacity: 0; }
}
.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--under);
  text-align: center;
}
.tagline {
  margin: 0;
  font-size: 19px;
  font-weight: 400;
  color: var(--bone-dim);
}
.dig {
  display: inline-flex;
  gap: 8px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--lime);
  text-decoration: none;
}
.dig span {
  display: inline-block;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  50% { transform: translateY(5px); }
}
.veil {
  position: absolute;
  inset: 0;
  background: var(--blue);
  opacity: 0;
  pointer-events: none;
}
/* the blue gives way to earth */
.veil.dirt {
  background: #231511 url('/img/soil.jpg') repeat 0 0 / 402px 215px; /* lined up with the soil below by roots.js */
  clip-path: circle(0% at 50% 50%); /* roots.js opens this up: the dirt breaks through */
  opacity: 1;
}
.into {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(34px, 7vw, 84px);
  line-height: 1.02;
  white-space: nowrap;
  overflow: hidden; /* the repeats run off both sides of the screen */
  pointer-events: none;
  visibility: hidden; /* roots.js shows it once the dirt breaks through */
  clip-path: circle(0% at 50% 50%);
}
/* the sentence, stacked many times over, all the same (roots.js slides them in) */
.into span {
  display: block;
  opacity: 0;
  color: var(--bone);
}
@media (max-width: 860px) {
  .into {
    line-height: 1.08;
  }
}

/* ---------- layers (the strata) ---------- */
/* all the soil is the hand-drawn crayon earth from the wallpaper, one continuous texture */
main {
  display: block;
  /* the same soil as the paintings (a cooler, darker brown than the wallpaper on the first screen) */
  background: #231511 url('/img/soil.jpg') repeat 0 0 / 402px 215px;
}
.layer {
  position: relative;
  overflow: clip; /* drawings may hang off the sides; never let them make the page scroll sideways */
  padding: clamp(64px, 8vw, 120px) 0;
  /* each layer only adds shade on top of the texture, so it gets darker as you dig */
  background: linear-gradient(var(--from, transparent), var(--to, transparent));
}
.layer-inner {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding-inline: clamp(24px, 5vw, 72px);
}
/* a block of content the root sends a branch to */
.chamber {
  position: relative;
  z-index: 2; /* above the root */
  scroll-margin-top: 90px;
}
.stratum {
  position: relative;
  z-index: 2;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acid);
}
.layer p.stratum {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--acid);
}
.layer h2,
.layer h3,
.bottominner strong {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--cream);
}
.layer h2 {
  font-size: clamp(58px, 7.8vw, 118px);
  line-height: 0.95;
  margin: 0.08em 0 0.25em;
}
.layer h3 {
  margin: 6px 0 10px;
  line-height: 1.02;
}
.textlink {
  display: inline-block;
  margin-top: 14px;
  font-weight: 700;
  color: var(--acid);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.textlink:hover {
  color: var(--cream);
}
/* the big drawings: decoration only */
.art {
  display: block;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}
/* a torn strip of soil in front of the bottom of a drawing, so it looks half-buried */
.wibble::after,
.seam-scene::after,
.bottominner::after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  right: -14vw;
  left: 44%;
  bottom: -3px;
  height: 22%;
  background: linear-gradient(170deg, #5a3d2a3a, #1a0f0b90), #231511 url('/img/soil.jpg') center / 390px 210px;
  clip-path: polygon(0 100%, 5% 96%, 9% 90%, 15% 88%, 19% 83%, 21% 84%, 24% 79%, 28% 80%, 35% 70%, 42% 77%, 48% 71%, 52% 62%, 57% 65%, 64% 49%, 69% 47%, 77% 35%, 81% 38%, 87% 24%, 93% 21%, 100% 0, 100% 100%);
}
.seam-scene::after {
  height: 19%;
  left: 32%;
  filter: brightness(0.76);
}
.bottominner::after {
  height: 24%;
  left: -8%;
  right: -7%;
  filter: brightness(0.53);
}
.art.visitor,
.art.seam-figure,
.bottominner .art {
  filter: drop-shadow(1px 5px 1px #130b099e);
}

/* ---------- about: the violet eyes are the background ---------- */
#about {
  z-index: 2;
  isolation: isolate;
  min-height: clamp(560px, 52vw, 900px);
  display: grid;
  align-content: center;
}
#about .eye-bank {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 30%; /* keep the dots that run off the top right in view */
  /* soft top and bottom edges, so it sinks into the soil around it */
  -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent);
  mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent);
}
#about .layer-inner {
  width: 100%;
}
.soilText {
  max-width: 41ch;
}
.soilText .lead {
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1.17;
  color: var(--cream);
  margin: 0.2em 0 0.5em;
}
.soilText p {
  color: var(--bone-dim);
}

/* ---------- games ---------- */
#games {
  --from: rgba(8, 4, 3, 0);
  --to: rgba(8, 4, 3, 0.14);
}
/* Nickel & Dime: the buried dial is a full-width band of soil, running off the left edge of the screen */
.gamepanel {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: grid;
  grid-template-columns: 40% 1fr;
  align-items: center;
  min-height: clamp(320px, 33vw, 620px);
  margin-top: 28px;
  padding: 24px 0;
  scroll-margin-top: 90px;
}
.gamepanel .dial-bank {
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(50% - 50vw); /* from the very left edge of the screen... */
  width: 100vw; /* ...to the right edge */
  height: 100%;
  object-fit: cover;
  object-position: left center;
  /* soft top and bottom edges, so it sinks into the soil around it */
  -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
}
.gamepanel > div {
  grid-column: 2;
}
.gamepanel h3 {
  font-size: clamp(43px, 5.4vw, 82px);
}
.gamepanel p {
  max-width: 42ch;
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--bone-dim);
}
.gamepanel h3 + p {
  color: var(--cream);
}
/* Wibble: the visitor climbs in from the right, half-buried */
.wibble {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 42% 1fr;
  grid-template-areas: 'copy .' 'still .';
  align-content: center;
  gap: 22px 0;
  min-height: clamp(510px, 50vw, 730px);
  margin-top: 20px;
  padding: 50px 0 40px;
}
.wibble > div {
  grid-area: copy;
  position: relative;
  z-index: 3;
}
.wibble h3 {
  font-size: clamp(43px, 5.4vw, 82px);
}
.wibble p {
  max-width: 42ch;
  margin: 0;
  font-size: 18px;
  color: var(--cream);
}
/* "whatever it takes" */
.wibble p strong {
  font-weight: 800;
  color: var(--acid);
}
.wibble small {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: #e6cfb4;
}
.wibble .textlink {
  font-size: 20px;
}
.still {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid #d3b390;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.still img {
  width: 100%;
  height: auto;
  display: block;
}
.wibble .still {
  grid-area: still;
  z-index: 3;
  width: min(86%, 360px);
  transform: rotate(-2deg);
}
.wibble .visitor {
  position: absolute;
  z-index: 1;
  right: -10vw;
  bottom: 3%;
  width: 78%;
}
/* the winged figure tearing through the paper, at the end of the games */
.torn-scene {
  position: relative;
  z-index: 1;
  height: clamp(320px, 36vw, 560px);
  margin-top: clamp(10px, 3vw, 40px);
}
.torn-scene .seam-figure {
  position: absolute;
  right: -8vw;
  bottom: -2%;
  width: 68%;
  transform: rotate(-4deg);
}
.torn-scene::after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  left: 32%;
  right: -14vw;
  bottom: -3px;
  height: 19%;
  filter: brightness(0.76);
  background: linear-gradient(170deg, #5a3d2a3a, #1a0f0b90), #231511 url('/img/soil.jpg') center / 390px 210px;
  clip-path: polygon(0 100%, 5% 96%, 9% 90%, 15% 88%, 19% 83%, 21% 84%, 24% 79%, 28% 80%, 35% 70%, 42% 77%, 48% 71%, 52% 62%, 57% 65%, 64% 49%, 69% 47%, 77% 35%, 81% 38%, 87% 24%, 93% 21%, 100% 0, 100% 100%);
}

/* ---------- sketchbook ---------- */
#sketchbook {
  padding-top: 0;
  /* the soil just keeps getting darker as you dig; no hard line between layers */
  --from: rgba(8, 4, 3, 0.14);
  --to: rgba(8, 4, 3, 0.36);
}
.seam-scene {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(420px, 43vw, 660px);
}
/* the fox painting: sized like the winged figure above it, on the right, its edges fading into the soil */
.fox-band {
  isolation: isolate;
  min-height: clamp(420px, 43vw, 660px);
}
.fox-band .fox-bank {
  position: absolute;
  z-index: -1;
  right: calc(50% - 50vw); /* flush with the right edge of the screen */
  top: 50%;
  translate: 0 -50%;
  width: 74%;
  height: auto;
  /* fades softly into the soil on the left, top and bottom; runs straight off the right edge */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 38%), linear-gradient(transparent, #000 22%, #000 80%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 38%), linear-gradient(transparent, #000 22%, #000 80%, transparent);
  mask-composite: intersect;
}
.fox-band .seam-copy {
  width: 36%;
}
.fox-band::after {
  display: none; /* the painting brings its own soil */
}
.seam-copy {
  position: relative;
  z-index: 3;
  width: 43%;
}
.seam-copy > p:last-child {
  font-size: 20px;
  color: var(--cream);
}
.art.seam-figure {
  position: absolute;
  z-index: 1;
  right: -8vw;
  bottom: -2%;
  width: 68%;
  transform: rotate(-4deg);
}
.book {
  position: relative;
  z-index: 3;
  margin-top: 1px;
  background: #271b1aee;
}
.book summary {
  cursor: pointer;
  padding: 20px 12px;
  border-block: 1px solid var(--keyline);
  color: var(--acid);
  font-size: 17px;
  font-weight: 700;
}
.archivegrid {
  padding: 24px 12px 4px;
  columns: 4 180px;
  column-gap: 18px;
}
.archivegrid button {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  break-inside: avoid;
  appearance: none;
  background: none;
  border: 0;
  text-align: left;
  color: var(--cream);
  cursor: zoom-in;
  font: inherit;
}
.archivegrid img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s;
}
.archivegrid button:hover img {
  transform: translateY(-3px) rotate(-0.6deg);
}
.archivegrid span {
  display: block;
  margin-top: 8px;
  font: 14px/1.3 ui-monospace, Menlo, monospace;
}
/* the viewer */
.viewer {
  max-width: 95vw;
  max-height: 94svh;
  padding: 12px;
  color: var(--cream);
  background: #251a17;
  border: 1px solid var(--keyline);
  border-radius: 6px;
}
.viewer::backdrop {
  background: #100b0be8;
}
.viewer-photo {
  display: block;
  max-width: 85vw;
  max-height: 72svh;
  margin: auto;
  object-fit: contain;
}
.viewerbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 10px;
}
.viewerbar span {
  font-size: 14px;
}
.viewerbar button,
.viewer .x {
  min-width: 42px;
  padding: 9px;
  color: var(--cream);
  background: #3c2920;
  border: 1px solid var(--keyline);
  cursor: pointer;
  font: inherit;
}
.viewer .x {
  position: absolute;
  top: 15px;
  right: 15px;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

/* ---------- the bottom ---------- */
.layer.deep {
  padding: 0;
  background: linear-gradient(rgba(8, 4, 3, 0.36), rgba(8, 4, 3, 0.85) 75%);
}
.bottominner {
  position: relative;
  z-index: 2;
  min-height: 460px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 85px 18%;
  text-align: center;
}
.bottominner strong {
  font-size: clamp(40px, 6vw, 90px);
  line-height: 1;
}
.bottominner .stratum {
  margin: 0;
}
.serpent,
.swimmer {
  position: absolute;
  z-index: -1;
  bottom: 0;
  width: 23%;
  max-width: 310px;
}
.serpent {
  left: -5%;
  transform: rotate(-30deg);
}
.swimmer {
  right: -5%;
  transform: rotate(-10deg);
}
.copyright {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 0 22px;
  text-align: center;
  font-size: 13px;
  color: #cfbdab;
}

/* ---------- the root (drawn by roots.js) ---------- */
.roots {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.roots .ink path {
  fill: none;
  stroke-linecap: round;
}
.roots .ink {
  opacity: 0.6; /* the root stays in the background of the drawings */
}
.roots .fine {
  opacity: 0.45;
}
/* the wallpaper's eyes, living in the soil */
.roots .peek {
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.06);
  opacity: 0.4;
  transition: transform 0.45s cubic-bezier(0.3, 1.7, 0.5, 1), opacity 0.3s;
}
.roots .peek.awake {
  transform: scaleY(1);
  opacity: 1;
}
.roots .peek image {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink-y 7s infinite;
}
@keyframes blink-y {
  0%, 95%, 100% { transform: scaleY(1); }
  97.5% { transform: scaleY(0.08); }
}
.roots .seed {
  fill: var(--lime);
  stroke: #1a0f08;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.roots .seed.on {
  transform: scale(1);
}
.roots .tip {
  transition: opacity 0.3s;
}

/* ---------- depth gauge ---------- */
.rail,
.depth {
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.rail.on,
.depth.on {
  opacity: 1;
}
.rail {
  position: fixed;
  z-index: 9;
  right: 26px;
  top: 50%;
  height: 58vh;
  transform: translateY(-50%);
  width: 150px;
}
.rail-line {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(244, 236, 214, 0.15);
  border-radius: 2px;
}
.rail-fill {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  background: var(--lime);
  border-radius: 2px;
}
.rail-marks span {
  position: absolute;
  right: 12px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(244, 236, 214, 0.38);
  transition: color 0.3s;
}
.rail-marks span::after {
  content: '';
  position: absolute;
  right: -15px;
  top: 50%;
  width: 8px;
  height: 2px;
  background: currentColor;
}
.rail-marks span.passed {
  color: var(--lime);
}
.rail-now {
  position: absolute;
  right: -7px;
  transform: translate(0, -50%);
  top: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--under);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.depth {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 9;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(20, 12, 7, 0.8);
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1100px) {
  .depth { display: none; }
}
@media (max-width: 1099px) {
  .rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 100vh; height: 100svh; }
  .logo-wrap, .dig span, .eye, .edge-eye, .roots .peek image { animation: none; }
  .roots .peek { transition: none; }
  .roots .seed { transition: none; }
}

/* ---------- phones / narrow ---------- */
@media (max-width: 860px) {
  :root {
    --spine: 0px;
  }
  body {
    font-size: 16px;
  }
  .brand {
    font-size: 17px;
  }
  .brand img {
    height: 32px;
  }
  nav {
    gap: 14px;
  }
  nav a {
    font-size: 14px;
  }
  .hero {
    height: 300vh;
  }
  .stage {
    --lw: min(58vw, 42svh);
    --lt: 11svh;
    --s: 0.46;
  }
  /* phone: like the wallpaper, eyes down both edges */
  .eye.l,
  .eye.l.r2 { left: 12vw; }
  .eye.r,
  .eye.r.r2 { left: 88vw; }
  .pot { top: calc(var(--under) + 80px); }
  .eye.r3 { top: calc(var(--under) + 92px) !important; } /* beside the pot, like the wallpaper */
  .eye.far { display: none; } /* phones already have eyes down both edges */
  .tagline {
    font-size: 16px;
    padding: 0 20px;
  }
  .layer-inner {
    padding: 0 18px 0 46px; /* the root runs down the left strip */
  }
}
@media (max-width: 520px) {
  .brand span {
    display: none; /* head mark alone on narrow phones, nav stays readable */
  }
  nav {
    gap: 12px;
  }
  nav a {
    font-size: 13px;
  }
}

/* ---------- underground on narrower screens ---------- */
@media (max-width: 1100px) {
  .wibble .visitor {
    width: 64%;
    right: -8vw;
  }
}
@media (max-width: 760px) {
  /* about: the eyes sit above the words */
  #about {
    display: flex;
    align-items: flex-end;
    min-height: 0;
    padding: clamp(320px, 88vw, 470px) 0 32px;
  }
  #about .eye-bank {
    height: clamp(330px, 95vw, 490px);
    object-position: 92% 35%;
    -webkit-mask-image: linear-gradient(#000 82%, transparent);
    mask-image: linear-gradient(#000 82%, transparent);
  }
  .layer h2 {
    font-size: clamp(48px, 13vw, 72px);
  }
  /* phone: the dial band runs edge to edge, the words sit under it */
  .gamepanel {
    display: block;
    min-height: 0;
    padding: clamp(210px, 62vw, 300px) 0 10px;
  }
  .gamepanel .dial-bank {
    left: -46px; /* the left strip where the root runs */
    width: 100vw;
    height: clamp(230px, 68vw, 330px);
    object-position: left center;
    -webkit-mask-image: linear-gradient(transparent, #000 6%, #000 80%, transparent);
    mask-image: linear-gradient(transparent, #000 6%, #000 80%, transparent);
  }
  .gamepanel h3 {
    font-size: 34px;
  }
  .gamepanel p,
  .wibble p {
    font-size: 16px;
  }
  .wibble {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 40px 0 0;
    gap: 16px;
  }
  .wibble .still {
    width: 62%;
    margin-top: 6px;
  }
  .wibble .visitor {
    position: relative;
    align-self: flex-end;
    width: 100%;
    margin: -10% -14% 0 0;
    right: auto;
    bottom: auto;
  }
  .wibble h3 {
    font-size: 44px;
  }
  /* phone: the words first, then the painting, cropped to the fox's face and paws */
  .seam-scene.fox-band {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding-top: 48px;
  }
  .fox-band .fox-bank {
    order: 1; /* under the words */
    width: 112%;
    max-width: none;
  }
  .fox-band .seam-copy {
    width: 100%;
  }
  .fox-band .fox-bank {
    position: relative;
    display: block;
    right: auto;
    top: auto;
    translate: none;
    margin: 10px -18px 0 auto; /* to the right edge of the screen */
    height: auto;
  }
  .torn-scene .seam-figure {
    width: 112%;
    right: -12%;
  }
  .torn-scene {
    height: clamp(220px, 62vw, 320px);
  }
  .wibble::after,
  .seam-scene::after {
    height: 9%;
    left: 11%;
    right: -13vw;
  }
  .seam-scene {
    display: block;
    min-height: 0;
    padding-top: 48px;
  }
  .seam-copy {
    width: 100%;
  }
  .seam-copy > p:last-child {
    font-size: 17px;
  }
  .art.seam-figure {
    position: relative;
    width: 112%;
    margin: -6px -12% 0 auto;
    right: auto;
    bottom: auto;
    transform: rotate(-3deg);
  }
  .archivegrid {
    columns: 2;
    column-gap: 12px;
  }
  .archivegrid span {
    font-size: 12px;
  }
  .bottominner {
    min-height: 380px;
    padding: 70px 12% 90px;
  }
  .serpent,
  .swimmer {
    width: 34%;
  }
}

.book-links {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0;
}
nav a[aria-current='page'] {
  color: var(--lime);
}

/* the little Instagram mark at the start of the menu, drawn in lines like the text */
nav {
  align-items: center;
}
nav a.ig {
  display: inline-flex;
  align-items: center;
}
nav a.ig svg {
  display: block;
  transition: transform 0.15s;
}
nav a.ig:hover svg {
  transform: scale(1.12);
}
.brand {
  flex-shrink: 0;
}
@media (max-width: 360px) {
  nav {
    gap: 9px;
  }
  nav a {
    font-size: 12px;
  }
  nav a.ig svg {
    width: 16px;
    height: 16px;
  }
}

/* ---------- a little life in the big drawings ---------- */
/* an almond-shaped cut-out of the eye, laid exactly over the drawing, squeezed shut for a moment;
   underneath it, the creature's own skin with a dark lash line, so a closed eye looks drawn */
.blink-eye,
.blink-lid {
  display: block;
  position: absolute;
  pointer-events: none;
  clip-path: polygon(0.0% 50.0%, 5.0% 37.6%, 10.0% 29.3%, 15.0% 22.3%, 20.0% 16.4%, 25.0% 11.4%, 30.0% 7.3%, 35.0% 4.1%, 40.0% 1.8%, 45.0% 0.5%, 50.0% 0.0%, 55.0% 0.5%, 60.0% 1.8%, 65.0% 4.1%, 70.0% 7.3%, 75.0% 11.4%, 80.0% 16.4%, 85.0% 22.3%, 90.0% 29.3%, 95.0% 37.6%, 100.0% 50.0%, 95.0% 62.4%, 90.0% 70.7%, 85.0% 77.7%, 80.0% 83.6%, 75.0% 88.6%, 70.0% 92.7%, 65.0% 95.9%, 60.0% 98.2%, 55.0% 99.5%, 50.0% 100.0%, 45.0% 99.5%, 40.0% 98.2%, 35.0% 95.9%, 30.0% 92.7%, 25.0% 88.6%, 20.0% 83.6%, 15.0% 77.7%, 10.0% 70.7%, 5.0% 62.4%);
}
.blink-eye {
  background-repeat: no-repeat;
  transition: scale 0.12s ease-in;
}
.blink-eye.shut {
  scale: 1 0.04;
  transition-duration: 0.08s;
}
.blink-lid::before {
  /* a rounded, crayon-grained lid rather than a flat colour */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 30%, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 80% 90% at 50% 100%, rgba(0, 0, 0, 0.28), transparent 70%),
    var(--grain);
  mix-blend-mode: multiply;
  opacity: 0.9;
}
.blink-lid::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: max(2px, 5%);
  translate: 0 -50%;
  border-radius: 50%;
  background: #140c10;
}
/* everything else just breathes, very slightly */
@media (prefers-reduced-motion: no-preference) {
  .gamepanel .dial-bank {
    animation: drift 16s ease-in-out infinite alternate;
  }
  .gamepanel .dial-bank {
    animation-duration: 19s;
    animation-delay: -6s;
  }
  .art.seam-figure {
    animation: breathe 6.5s ease-in-out infinite alternate;
  }
  .serpent {
    transform-origin: 50% 100%;
    animation: sway-art 7s ease-in-out infinite alternate;
  }
  .swimmer {
    transform-origin: 50% 100%;
    animation: sway-art 8.5s ease-in-out infinite alternate-reverse;
  }
}
@keyframes drift {
  from { scale: 1; translate: 0 0; }
  to { scale: 1.018; translate: -6px -3px; }
}
@keyframes breathe {
  from { translate: 0 0; scale: 1; }
  to { translate: 0 -5px; scale: 1.01; }
}
@keyframes sway-art {
  from { rotate: -1.6deg; }
  to { rotate: 1.6deg; }
}

/* ---------- "tell me when a new game comes out" (signup.js) ---------- */
/* The email line is a root like the big one; two soil eyes watch; the arrow is the Psychosis arrow;
   when you sign up the arrow goes and two leaves sprout from the root. */
.signup {
  position: relative;
  z-index: 3;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 110px 24px 0;
  text-align: center;
}
/* a darker patch of soil so the words read over the root behind */
.signup::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 40px -12% -60px;
  background: radial-gradient(closest-side, rgba(16, 9, 6, 0.82), rgba(16, 9, 6, 0.55) 55%, transparent);
  pointer-events: none;
}
.layer .signup-title {
  max-width: 11em;
  margin: 0 auto 30px;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.04;
  text-wrap: balance;
}
.signup-eye {
  position: absolute;
  top: 128px;
  width: 92px;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(1px 4px 2px #0b0604aa);
}
.signup-eye.l {
  left: -58px;
  rotate: -8deg;
}
.signup-eye.r {
  right: -58px;
  rotate: 7deg;
  transform: scaleX(-1); /* looking the other way (not scale:, which the blink uses) */
}
/* a third one, lower down on the right, so that side isn't so empty */
.signup-eye.r2 {
  top: 336px;
  right: -20px;
  width: 78px;
  rotate: -12deg;
}
.signup-form {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
}
.signup-field {
  position: relative;
  flex: 0 1 400px;
  min-width: 0;
}
.signup-field input {
  display: block;
  width: 100%;
  padding: 8px 4px 13px;
  border: 0;
  outline: 0;
  background: none;
  font: 400 22px/1.2 Outfit, system-ui, sans-serif;
  color: var(--cream);
  caret-color: var(--lime);
  transition: text-align 0s, color 0.6s;
}
.signup-field input::placeholder {
  color: rgba(255, 239, 217, 0.42);
}
.signup-root {
  position: absolute;
  left: -3%;
  bottom: -9px;
  width: 106%;
  height: 22px;
  overflow: visible;
  pointer-events: none;
}
.signup-root .main {
  fill: #9cb51c;
  transition: fill 0.8s;
}
.signup-root .hair {
  fill: none;
  stroke: #8aa21a;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke 0.8s;
}
.signup-field:focus-within .signup-root .main {
  fill: var(--lime);
}
.signup-field:focus-within .signup-root .hair {
  stroke: #a9c81a;
}
.signup.bad .signup-root .main {
  fill: #e3541c;
}
.signup.bad .signup-root .hair {
  stroke: #c84a18;
}
/* the leaves: tucked into the root until you sign up */
.signup-leaf {
  position: absolute;
  bottom: -6px;
  height: 34px;
  width: auto;
  pointer-events: none;
  /* soften the soil around the drawing so it sits in this soil */
  -webkit-mask-image: radial-gradient(ellipse 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50%, #000 62%, transparent 100%);
  scale: 0;
  opacity: 0;
  transition: scale 1.6s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.8s;
}
.signup-leaf.a {
  right: 88%;
  transform-origin: 100% 50%;
  rotate: 28deg;
}
.signup-leaf.b {
  left: 90%;
  height: 28px;
  transform-origin: 0 50%;
  rotate: -32deg;
  transition-delay: 0.35s;
}
.signup.done .signup-leaf {
  scale: 1;
  opacity: 1;
}
.signup.done .signup-field input {
  text-align: center;
  color: var(--bone);
}
/* the arrow from the Psychosis pages, blinking */
.signup-go {
  flex: none;
  width: 92px;
  height: 62px;
  margin: 0 0 -6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 5px rgba(10, 4, 2, 0.7));
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.7s, width 0.9s, margin 0.9s;
}
.signup-go svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.signup-go:focus-visible {
  outline: 2px dashed var(--acid);
  outline-offset: 4px;
  border-radius: 8px;
}
.signup.done .signup-go {
  width: 0;
  margin-left: -16px;
  opacity: 0;
  pointer-events: none;
}
.signup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.signup-note {
  min-height: 1.6em;
  margin: 22px 0 0;
  font-size: 15px;
  color: var(--bone-dim);
}
.signup-note .textlink {
  margin: 0 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .signup-eye {
    transform-origin: 50% 50%;
    animation: blink 7.5s infinite;
  }
  .signup-eye.r {
    animation-duration: 9s;
    animation-delay: -3s;
  }
  .signup-eye.r2 {
    animation-duration: 6.2s;
    animation-delay: -1.4s;
  }
  .signup.blinked .signup-eye {
    animation: blink-once 0.45s 1;
  }
  .signup-go .lid {
    transform-box: fill-box;
    transform-origin: center;
    animation: arrow-lid 6s infinite;
  }
  .signup-go:hover .tip,
  .signup-go:focus-visible .tip,
  .signup.sending .signup-go .tip {
    animation: arrow-nudge 0.9s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .signup-go .lid {
    display: none;
  }
}
@keyframes blink-once {
  50% { scale: 1 0.08; }
}
@keyframes arrow-lid {
  0%, 94%, 100% { scale: 1 0; }
  97% { scale: 1 1; }
}
@keyframes arrow-nudge {
  50% { translate: 5px 0; }
}
@media (max-width: 640px) {
  .signup {
    padding: 80px 22px 0;
  }
  .signup::before {
    inset: 30px -6% -50px;
  }
  .signup-eye {
    top: 26px;
    width: 62px;
  }
  .signup-eye.l {
    left: 14%;
  }
  .signup-eye.r {
    right: 14%;
  }
  .signup-eye.r2 {
    display: none;
  }
  .layer .signup-title {
    font-size: 31px;
    margin-bottom: 24px;
  }
  .signup-form {
    gap: 10px;
  }
  .signup-field {
    flex: 1 1 auto;
  }
  .signup-field input {
    font-size: 18px;
  }
  .signup-go {
    width: 74px;
    height: 50px;
  }
  .signup-leaf {
    height: 26px;
  }
  .signup-leaf.a {
    right: 76%;
  }
  .signup-leaf.b {
    left: 82%;
    height: 22px;
  }
}

/* ---------- root tongue (rootspeak.js): the secret button under "Back to the surface" ---------- */
.rootspeak {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0 auto 14px;
  padding: 6px 10px;
  border: 0;
  background: none;
  font: 400 15px/1 'Noto Sans Ogham', Outfit, system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: var(--bone);
  opacity: 0.28;
  cursor: pointer;
  transition: opacity 0.4s, color 0.4s, text-shadow 0.4s;
}
.rootspeak:hover,
.rootspeak:focus-visible {
  opacity: 1;
  color: #ffb547;
  text-shadow: 0 0 10px rgba(255, 140, 30, 0.6);
  outline: 0;
}
.rooted .rootspeak {
  font-family: Outfit, system-ui, sans-serif;
  opacity: 0.7;
}
.rt,
.rt-ph::placeholder,
.rt-ink {
  font-family: 'Noto Sans Ogham', 'Noto Sans Runic', serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  word-spacing: 0.15em;
}
.rt {
  animation: rt-grow 0.7s ease-out both;
}
@keyframes rt-grow {
  from {
    opacity: 0;
    filter: blur(4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rt {
    animation: none;
  }
}
/* the logo's wordmark, rewritten in root-tongue over the hidden strip of the picture */
.rt-logo-on {
  position: relative;
}
.rt-logo-on #logo {
  clip-path: inset(0 0 21.4% 0);
}
.rt-logo {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  pointer-events: none;
  font-family: 'Noto Sans Ogham', serif;
  color: #fffdf6;
  line-height: 1;
  animation: rt-grow 0.7s ease-out both;
}
.rt-logo .rt-word {
  position: absolute;
  left: 0;
  right: 0;
  top: 80.2%;
  text-align: center;
  white-space: nowrap;
  -webkit-text-stroke: 0.035em #fffdf6; /* Ogham only comes in one weight; thicken it like the wordmark */
}
.rt-logo .rt-word.sub {
  top: 91.6%;
  font-size: 0.7em;
  -webkit-text-stroke-width: 0.02em;
}
/* the email box while in root-tongue: the real text is hidden, its root-tongue twin is painted on top */
.signup-field input.rt-typed {
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
}
.rt-ink {
  position: absolute;
  color: var(--cream); /* same as the email box's own text */
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
  line-height: 1.2;
  box-sizing: border-box;
}
.signup.done .rt-ink {
  color: var(--bone);
}
.rt-ink.focus::after {
  content: '';
  flex: none;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--lime);
  animation: rt-caret 1s steps(1) infinite;
}
@keyframes rt-caret {
  50% {
    opacity: 0;
  }
}

/* ---------- Red Journal: an empty screenshot frame until there's a real one ---------- */
.wibble .rj-shot {
  margin: 0;
  aspect-ratio: 1200 / 630;
  background: #211a16;
  display: grid;
  place-items: center;
}
.rj-shot img:not([src]),
.rj-shot img[src=''] {
  display: none;
}
.rj-shot img[src]:not([src='']) {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rj-shot img[src]:not([src='']) + .rj-shot-label {
  display: none;
}
.rj-shot-label {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #c2ae97;
}
/* no demo yet: the link is there but asleep */
.demo-link[aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
  text-decoration-style: dashed;
}
.demo-link[aria-disabled='true']:hover {
  color: var(--acid);
}
.demo-soon {
  margin-left: 10px;
  font-size: 13px;
  color: #e6cfb4;
}

/* ---------- the Junkyard: a mountain with a mouth that opens (from the designer's site kit) ---------- */
#junkyard {
  position: relative;
  z-index: 3;
  isolation: isolate;
  scroll-margin-top: clamp(70px, 8vh, 100px);
  margin: clamp(55px, 8vw, 108px) 0 clamp(42px, 6vw, 80px);
  color: var(--cream);
  display: grid;
  grid-template-columns: minmax(185px, 0.57fr) minmax(0, 1.43fr);
  gap: clamp(18px, 3vw, 48px);
  align-items: start;
}
#junkyard * {
  box-sizing: border-box;
}
.yard-copy {
  padding-top: clamp(24px, 5vw, 76px);
  position: relative;
  z-index: 2;
}
#junkyard h3 {
  font-size: clamp(46px, 5vw, 87px);
  line-height: 1;
  letter-spacing: -0.055em;
  margin: 0 0 12px;
}
#junkyard .yard-copy p {
  margin: 0 0 16px;
  max-width: 23ch;
  color: var(--bone);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.5;
}
.yard-switch {
  font: 650 17px/1.4 Outfit, sans-serif;
  cursor: pointer;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--acid);
}
.yard-switch:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
}
.yard-maw {
  --open-gap: clamp(330px, 32vw, 430px); /* room for three games in a column */
  position: relative;
  width: 100%;
  max-width: 710px;
  justify-self: center;
  align-self: center;
  isolation: isolate;
  container-type: inline-size;
}
/* the dark inside of the mouth, behind the teeth */
.yard-maw::before {
  content: '';
  position: absolute;
  inset: 24% 2.7% 19%;
  z-index: -1;
  background: #120e17;
  clip-path: polygon(1% 3%, 50% 0, 98% 2%, 100% 18%, 98% 36%, 99% 65%, 96% 94%, 61% 100%, 7% 98%, 0 84%, 2% 59%, 0 34%);
}
.yard-jaw {
  position: relative;
  z-index: 2;
  display: block;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.yard-jaw img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.yard-jaw.top-jaw {
  transform-origin: 94% 77%;
  transition: transform 0.42s ease;
}
.yard-jaw.bottom-jaw {
  transform-origin: 8% 20%;
  transition: transform 0.42s ease;
  margin-top: -2%;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #junkyard:not(.is-open) .yard-maw:hover .top-jaw {
    transform: translateY(-3px) rotate(-0.6deg);
  }
  #junkyard:not(.is-open) .yard-maw:hover .bottom-jaw {
    transform: translateY(2px) rotate(0.4deg);
  }
}
.yard-gap {
  height: 0;
  position: relative;
  transition: height 650ms cubic-bezier(0.33, 0.03, 0.18, 1);
}
#junkyard.is-open .yard-gap {
  height: max(var(--open-gap), var(--fit, 0px));
}
.yard-throat {
  position: absolute;
  inset: -42px 1% -34px;
  pointer-events: none;
  z-index: 0;
  clip-path: polygon(3% 0, 94% 0, 100% 3%, 99% 20%, 97% 40%, 98.5% 66%, 97% 79%, 100% 98%, 1% 100%, 0 84%, 2.2% 67%, 0.4% 40%, 2% 23%);
  background: radial-gradient(ellipse at 47% 56%, #161121 14%, #251728 59%, #452641 90%, #331a28);
}
/* the ink garden drawing, faint, on the walls of the throat */
.yard-throat::before,
.yard-throat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/img/junkyard/ink-garden.webp') center / cover;
  mix-blend-mode: screen;
  opacity: 0.3;
  filter: grayscale(1) invert(1);
  -webkit-mask-image: linear-gradient(90deg, #000a, #0001 14%, transparent 30%, transparent 77%, #0006 92%, #000b);
  mask-image: linear-gradient(90deg, #000a, #0001 14%, transparent 30%, transparent 77%, #0006 92%, #000b);
}
.yard-throat::after {
  transform: scaleX(-1) rotate(180deg);
  opacity: 0.1;
  background-position: 50% 30%;
  -webkit-mask-image: linear-gradient(#0009, transparent 70%);
  mask-image: linear-gradient(#0009, transparent 70%);
}
/* one column of games (picture, name, short description); up to three fit, and fewer sit in the middle */
.yard-words {
  position: absolute;
  inset: 0 9% 2%;
  z-index: 3;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 2cqw, 16px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.16s ease;
}
#junkyard.is-open .yard-words {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.38s ease 0.22s;
}
.yard-slot {
  transform: translateX(var(--dx, 0px)) rotate(var(--turn, 0deg));
}
.yard-game {
  display: grid;
  grid-template-columns: clamp(96px, 28cqw, 170px) 1fr;
  align-items: center;
  gap: clamp(10px, 3cqw, 20px);
  color: var(--letter, #ede4bd);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  animation: game-drift var(--period, 8s) ease-in-out var(--delay, -1s) infinite alternate;
}
.yard-game img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #d3b390;
  border-radius: 4px;
  box-shadow: 0 8px 18px #0008;
  transform: rotate(-2deg);
}
.yg-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.yg-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(22px, 5cqw, 34px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-shadow: 1px 2px 2px #09060d;
}
.yg-desc {
  margin-top: 3px;
  font-size: clamp(12px, 2.2cqw, 15px);
  line-height: 1.35;
  color: #d9cfc0;
}
.yg-play {
  margin-top: 4px;
  font-size: clamp(12px, 2.2cqw, 15px);
  font-weight: 700;
  color: var(--acid);
}
.yard-game[data-junk='coldroom'] {
  --letter: #c5dbec;
}
.yard-game[data-junk='wibble'] {
  --letter: #dfe58a;
}
.yard-game[data-junk='terrarium'] {
  --letter: #f0c25a;
}
.yard-game:hover,
.yard-game:focus-visible {
  animation-play-state: paused;
}
.yard-game:hover .yg-name,
.yard-game:focus-visible .yg-name {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.yard-game:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 6px;
}
@keyframes game-drift {
  0% { transform: translate(-3px, 2px) rotate(-0.6deg); }
  48% { transform: translate(1px, -3px) rotate(0.5deg); }
  100% { transform: translate(3px, 2px) rotate(-0.3deg); }
}
/* wide screens have room on the left: slide the copy over so "Junkmouth" clears the jaws */
@media (min-width: 1380px) {
  .yard-copy {
    margin-left: -5vw;
  }
}
@media (max-width: 820px) {
  #junkyard {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .yard-copy {
    padding: 0;
  }
  #junkyard .yard-copy p {
    max-width: 38ch;
    margin-bottom: 6px;
  }
  .yard-maw {
    --open-gap: clamp(300px, 88vw, 400px);
    max-width: 580px;
  }
  .yard-words {
    inset: 0 7% 2%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .yard-maw * {
    transition: none !important;
    animation: none !important;
  }
}
.j-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* the winged figure on the left side, coming out of the left edge of the screen. It takes no room of its
   own: it hangs into the soil that was already between the sketchbook and the sign-up */
.torn-scene.left {
  height: 0;
  margin: 0;
}
#sketchbook {
  z-index: 4; /* so he can hang down past the sketchbook's bottom edge, over the soil above the sign-up */
  overflow-x: clip;
  overflow-y: visible;
}
.torn-scene.left .seam-figure {
  top: clamp(10px, 2vw, 30px);
  bottom: auto;
  right: auto;
  left: -22vw;
  width: 54%;
  transform: rotate(4deg);
}
.torn-scene.left::after {
  display: none; /* no soil strip over him here */
}
@media (max-width: 760px) {
  .torn-scene.left .seam-figure {
    position: absolute;
    margin: 0;
    top: 4px;
    right: auto;
    width: 62%;
    left: -32%; /* past the left edge of the screen, like on a computer */
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  /* narrower screens: keep him a little further out, clear of the email box */
  .torn-scene.left .seam-figure {
    left: -30vw;
  }
}
