/* THE STORY: the dive into his hair, the lines that hang in the tunnel, the closing quote, and the marks that show how far through you are. */

/* ---------- the dive. Scrolling flies the eye into his hair and on down a tunnel of threads; where the threads close in, that is the second screen ---------- */
#veil {
  position: absolute;
  left: -25%;
  top: -25%;
  width: 150%;
  height: 150%;
  display: block;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
} /* the nest at the far end of the tunnel: thousands of fine loose threads, so many toward the middle that they close into black. Bigger than the screen, so its ragged outside is never cut off */
.flood {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
} /* the blue closing over what the threads have covered: from the edges of the screen in toward the words, a step behind the threads */
.track {
  height: 500vh;
} /* the long track you scroll along; the script sets its true length */
/* inside his head the words are IN the tunnel: each line hangs at its own depth along the way. It is small, faint and soft while it is still ahead, grows as you scroll toward it,
   holds almost still at reading size, then grows past you and is gone. The script places them; these rules only say how each one is set */
.inside {
  position: absolute;
  z-index: 3;
  inset: 0;
  color: var(--paper);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  --fm: clamp(18px, 1.6vw, 30px);
} /* one sentence alone on a dark screen reads as large lead text, not a headline: about 30 on a big monitor, 23 on a laptop, 18 on a phone. Mono is wide, so it already looks a size bigger than those numbers */
.ln {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  width: max-content;
  visibility: hidden;
  font:
    500 var(--fm) / 1.36 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.ln p {
  margin: 0;
}
.ln.q {
  font:
    400 calc(var(--fm) * 1.75) / 1.08 'Reenie Beanie',
    'Bradley Hand',
    cursive;
  letter-spacing: 0.01em;
}
#lEnd {
  display: block;
}
#lEnd > p:first-child {
  max-width: 12em;
  margin: 0 auto;
} /* the quote is centred under the flower, and the name signs off small under its right-hand end */
@media (max-width: 760px) {
  #cue2 {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
} /* on a phone the cue sits above the three progress strokes, not on them */
/* the closing line is his own, written by hand and signed like a letter. Handwriting runs small, so it is set half as big again to look the same size as the lines before it */
.ln .sig {
  position: relative;
  display: block;
  width: max-content;
  margin: 0.3em 4% 0 auto;
  font-size: 0.56em;
  line-height: 1;
  color: #8e99ff;
  transform: rotate(-4deg);
  transform-origin: 100% 50%;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.ln .sig.on {
  opacity: 1;
}
.ln .sig svg {
  position: absolute;
  left: -8%;
  bottom: -0.34em;
  width: 116%;
  height: 0.42em;
}
.ln .sig path {
  stroke: currentColor;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1 1.2;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.8s ease 0.3s;
}
.ln .sig.on path {
  stroke-dashoffset: 0;
} /* the name, then a quick stroke under it */
#rows,
#wave {
  visibility: hidden;
}
#turn {
  z-index: 6;
  visibility: hidden;
} /* coming back up from the work: the paper over the whole story that turns blue a grain at a time (THE TURN in story.js) */
/* the last screen says where the path goes next: bottom right, where "Scroll to dive in" sat on the first screen */
.cue2 {
  all: unset;
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  width: max-content;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  font:
    400 14px/1.45 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.01em;
  color: var(--paper);
  cursor: pointer;
  padding: 10px 14px;
  margin: -10px auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    visibility 0s 0.6s;
}
.cue2.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.cue2::after {
  content: '\2193';
  display: inline-block;
  margin-left: 0.55em;
  animation: drop 1.6s cubic-bezier(0.45, 0, 0.3, 1) infinite;
} /* the last screen: "Scroll to see the work" in the middle at the bottom, its arrow falling again and again, so the way on is plain */
.cue2:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
  border-radius: 4px;
}
@keyframes drop {
  0% {
    transform: translateY(-5px);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  70% {
    transform: translateY(5px);
    opacity: 1;
  }
  100% {
    transform: translateY(9px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cue2::after {
    animation: none;
  }
}
.ln.c {
  text-align: center;
}
.ln.c .row {
  justify-content: center;
}
.ln .giant {
  font:
    800 clamp(60px, 9.6vw, 164px) / 0.92 Archivo,
    'Arial Narrow',
    Arial,
    sans-serif;
  font-stretch: 112%;
  letter-spacing: -0.04em;
  margin: 0.05em 0 0.09em -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
} /* a number worth stopping on, in the headline's face */
.ln .giant.g2 {
  font-size: clamp(40px, 7.4vw, 128px);
}
.ln .row {
  display: flex;
  align-items: center;
  gap: 0.9em;
}
.ln svg {
  display: block;
  overflow: visible;
  flex: none;
}
.ln .vis {
  margin: 0 0 0.55em;
}
#sorbit {
  position: static;
  inset: auto;
  display: block;
  width: 9.4em;
  height: 6em;
  margin: -1em auto -0.25em;
} /* the Sorbit mark as a swirl of thread, above the line that names it. Its box is roomier than the mark, so flyaway loops are not cut off */
.ln svg text {
  font:
    500 12.5px 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  fill: var(--paper);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.ln .th {
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
} /* the small drawings: one thread each, drawn as you come toward them */
/* how far through his head you are: three short strokes, one for each thought, filling as you go. Bottom left, where his name sat on the first screen */
.prog {
  position: absolute;
  z-index: 4;
  left: max(24px, 2.6vw, env(safe-area-inset-left, 0px));
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
}
.prog i {
  position: relative;
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: rgba(246, 244, 239, 0.24);
  overflow: hidden;
}
.prog i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform-origin: 0 50%;
  transform: scaleX(var(--k, 0));
}
@media (max-width: 760px) {
  .cue2 {
    font-size: 11.5px;
    white-space: nowrap;
  }
}

.ln .nw {
  white-space: nowrap;
} /* a word that must not break at its hyphen (AI-powered) */
#pull {
  display: block;
} /* screen two's tangle and the thread pulled out of it: shown in the still version too, like the other small drawings */
