/* ==================================================================== *
 * Intro
 * ==================================================================== */
#intro { position: fixed; inset: 0; z-index: 10; pointer-events: none; display: none; color: #fff; }
#intro.show { display: block; }

/* the white page, and the hole in it */
.white {
  position: fixed; inset: 0; background: #fff; display: grid; place-items: center; pointer-events: auto;
  --r: 0px;
}
.white.portal {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px));
          mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - .5px), #000 calc(var(--r) + .5px));
}
.type {
  margin: 0; display: inline-flex; align-items: baseline; white-space: nowrap; color: #0b0b0c;
  font: 600 clamp(40px, 8.4vw, 132px)/1 Geologica, Onest, sans-serif; letter-spacing: -.045em;
  transition: transform .65s cubic-bezier(.7,0,.25,1);
}
.words { display: inline-block; overflow: hidden; white-space: pre; }
.words.fold { transition: max-width .95s cubic-bezier(.7,0,.25,1), opacity .5s .45s; opacity: 0; }
.dot {
  display: none; width: .19em; height: .19em; margin-left: .04em; border-radius: 50%; background: #0b0b0c;
  flex: none; align-self: baseline; transform-origin: 50% 50%;
}
.dot.on { display: inline-block; }
.dot.beat { animation: beat 1.1s cubic-bezier(.3,0,.3,1) infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.28); } 28% { transform: scale(1); } 42% { transform: scale(1.14); } 60% { transform: scale(1); } }
.caret { display: inline-block; width: .055em; height: .82em; margin-left: .05em; background: #0b0b0c; align-self: center; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- the sentence beside the planet ---------- */
.say {
  position: fixed; z-index: 3; left: max(24px, 7vw); top: 50%; width: min(50vw, 960px);
  transform: translateY(-50%); color: #fff; pointer-events: none;
}
.say-line {
  margin: 0; font: 300 clamp(34px, 4.1vw, 80px)/1.18 Geologica, Onest, sans-serif;
  letter-spacing: -.035em; pointer-events: auto;
}
.say-foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.say-hint { margin: 0; max-width: 40ch; font: 400 clamp(14px, .95vw, 17px)/1.5 Onest, sans-serif; color: rgba(255,255,255,.45); }

/* the word you scroll: a size up from the rest of the sentence. The drum
   is as tall as the answer in the middle (set by intro.js), so the
   underline and the full stop after it stay with the word. */
.say-row { display: flex; align-items: center; margin: .78em 0 .8em; white-space: nowrap; font-size: 1.2em; }
.say[data-kind="lang"] .say-row { margin-top: .8em; }
.drum {
  position: relative; display: inline-block; flex: none; height: 1.18em;
  cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
}
.drum::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: 2px; border-radius: 2px;
  background: currentColor; opacity: .3;
}
.drum:focus-visible::after { opacity: .9; }
.drum-item {
  position: absolute; left: 0; top: 50%; margin-top: -.59em; white-space: nowrap; font-weight: 400; color: rgba(255,255,255,.9);
  transform-origin: 0 50%; cursor: pointer; transition: color .25s;
  will-change: transform, opacity;
}
.drum-item.on { color: var(--c); }
/* what follows the answer (". " or ", please."): part of its line, in the sentence's own colour and weight */
.drum-post { color: #fff; font-weight: 300; }
.say-pre { display: block; }
.say-go {
  display: inline-grid; place-items: center; flex: none; width: .8em; height: .8em; margin-left: .24em;
  border-radius: 50%; background: #fff; color: #0b0b0c; transition: transform .25s cubic-bezier(.3,1.6,.5,1), background .2s;
}
.say-go svg { width: 50%; height: 50%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.say-go:hover { transform: translateX(4px); }
.say-go:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.say[data-kind="modes"] .say-go { background: var(--go, #fff); }

/* coming and going */
.say .say-line, .say .say-foot { opacity: 0; transform: translateY(24px); }
.say.in .say-line, .say.in .say-foot { opacity: 1; transform: none; transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.say.in .say-foot { transition-delay: .5s; }
.say.out .say-line, .say.out .say-foot { opacity: 0; transform: translateY(-24px); transition: opacity .35s ease, transform .4s ease-in; }
.say.picked .drum-item:not(.on) { opacity: 0 !important; transition: opacity .2s; }
.say.picked .say-go { transform: translateX(10px) scale(.9); }

.st-back, .st-close {
  position: fixed; top: max(20px, env(safe-area-inset-top)); pointer-events: auto;
  font: 500 14px/1 Onest, sans-serif; color: rgba(255,255,255,.7); padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,.2);
}
.st-back { left: 24px; } .st-close { right: 24px; }
.st-back:hover, .st-close:hover { color: #fff; border-color: #fff; }

/* no WebGL: the sentence sits alone on the dark page */
#intro.flat { background: #07080d; pointer-events: auto; }

/* tall screens: planet above, sentence below; the arrow leaves the
   sentence and sits, bigger, beside the hint */
@media (max-aspect-ratio: 9/10) {
  .say { left: 20px; right: 20px; width: auto; top: auto; bottom: max(40px, 8vh); transform: none; }
  .say-line { font-size: clamp(30px, 9vw, 52px); }
  .say-row { font-size: 1.22em; margin: .86em 0 .9em; }
  .say-hint { font-size: 13.5px; }
  .say-foot .say-go { width: 54px; height: 54px; margin: 0; }
  .say-foot .say-go svg { width: 44%; height: 44%; }
}
