/* Keep Your Judgment · the "rain" page.
   Everything is fixed to the screen: the world (four voxel scenes), Joe, and one chapter of copy
   at a time. Scrolling only moves an invisible track; JS turns that into a smoothed position that
   fades chapters in and out, crossfades scenes, and brings Joe's pieces home.
   Wide: copy on the left, Joe big on the right.  Narrow: Joe big in the top half, copy below. */

:root {
  --night: #141a3d;
  --text: #f4f5fa;
  --text-2: #d3d8e6;
  --sun: #ffd23f;
  --sun-lo: #b8901a;
  --sun-ink: #141418;

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pixel: "Silkscreen", "IBM Plex Mono", ui-monospace, monospace;
  --edge: clamp(20px, 5vw, 80px);
  /* the composition stops growing at 1760px and centres; wider screens just see more sky */
  --frame: min(100vw, 1760px);
  --fl: calc((100vw - var(--frame)) / 2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; overflow-x: hidden;
  background: var(--night); color: var(--text);
  font: 500 18px/1.5 var(--display);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.joeville-stage { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; z-index: -1; overflow: hidden; }

/* ---------------------------------------------------------------- the world */
.world { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scenes { position: absolute; inset: 0; will-change: filter; }
.scene { position: absolute; inset: 0; opacity: 0; }
.scene img { width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(var(--z, 1.08)); will-change: transform; }
.puff { position: absolute; left: 0; top: 0; max-width: none; opacity: 0; will-change: transform, opacity; }
.fog { position: absolute; inset: 0; background: #e9eef6; opacity: 0; }
/* the copy side of the screen is a little darker, so the words always read */
.shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 11, 28, .72) 0%, rgba(8, 11, 28, .45) 34%, rgba(8, 11, 28, 0) 58%); }
@media (max-width: 899px) {
  .shade { background: linear-gradient(180deg, rgba(8, 11, 28, .25) 0%, rgba(8, 11, 28, 0) 18%, rgba(8, 11, 28, 0) 42%, rgba(8, 11, 28, .8) 62%, rgba(8, 11, 28, .92) 100%); }
}
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* ---------------------------------------------------------------- Joe */
.joe-stage { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.joe {
  position: absolute; left: 0; top: 0;
  width: var(--jw, 400px); height: var(--jh, 460px);
  transform: translate3d(var(--jx, 70vw), var(--jy, 50vh), 0) translate(-50%, -50%);
}
.ghosts, .parts { position: absolute; inset: 0; }
.ghost, .part { position: absolute; max-width: none; }
.part { will-change: transform; filter: drop-shadow(0 10px 18px rgba(8, 12, 40, .3)); transition: opacity .6s; }
/* the outline: a flat grey shadow of each missing piece, where it goes */
.ghost {
  /* each piece gets its own light edge, so the outline reads as six separate parts */
  filter: brightness(0) invert(24%) drop-shadow(1.5px 0 0 #d9dde8) drop-shadow(-1.5px 0 0 #d9dde8) drop-shadow(0 1.5px 0 #d9dde8) drop-shadow(0 -1.5px 0 #d9dde8);
  opacity: var(--go, .62); transition: opacity .6s;
}
.part.snap { animation: snap .8s cubic-bezier(.16, .84, .26, 1); }
@keyframes snap {
  0% { filter: drop-shadow(0 0 0 rgba(255, 210, 63, 0)) brightness(1); }
  25% { filter: drop-shadow(0 0 26px rgba(255, 210, 63, 1)) brightness(1.4); }
  100% { filter: drop-shadow(0 10px 18px rgba(8, 12, 40, .3)) brightness(1); }
}
.triumph { position: absolute; left: -3.983%; bottom: 0; width: 115.244%; height: auto; max-width: none; opacity: 0; transition: opacity .6s; } /* 109_emotion_triumphant: hat lines up with the assembled hat, fist raised above the box */
html.landed .part, html.landed .ghost { opacity: 0; }
html.landed .triumph { opacity: 1; }

/* a HUD tag on the piece that just came home */
.tag {
  position: absolute; left: 0; top: 0; margin: 0; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff;
  transform: translate(var(--tx, 0), var(--ty, 0));
}
.tag::before { content: ""; width: 44px; height: 1px; background: rgba(255, 255, 255, .85); }
.tag.flip { flex-direction: row-reverse; transform: translate(var(--tx, 0), var(--ty, 0)) translateX(-100%); }
.tag-n { padding: 6px 8px; border: 1px solid rgba(255, 255, 255, .7); background: rgba(10, 14, 32, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tag-k { display: none; }

/* ---------------------------------------------------------------- corner HUD */
.mark, .alt { position: fixed; z-index: 4; margin: 0; pointer-events: none; }
.mark {
  left: calc(var(--fl) + var(--edge)); top: max(22px, env(safe-area-inset-top));
  font: 700 15px/1 var(--display); letter-spacing: -.01em; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
.alt {
  right: calc(var(--fl) + max(18px, var(--edge) - 30px)); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font: 400 12px/1 var(--pixel); color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.alt-v { font-size: 15px; color: var(--sun); }
.alt-k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.alt-rail { position: relative; width: 1px; height: 34vh; background: rgba(255, 255, 255, .45); }
.alt-dot { position: absolute; left: 50%; top: var(--ap, 0%); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--sun); transform: rotate(45deg); box-shadow: 0 0 10px rgba(255, 210, 63, .8); }
@media (max-width: 899px) {
  .alt { top: 22%; right: 12px; }
  .alt-rail { height: 20vh; }
  .tag { display: none; }
}

/* "Join the cohort": top right, for the whole page. */
.join {
  position: fixed; z-index: 5; top: max(14px, env(safe-area-inset-top)); right: calc(var(--fl) + var(--edge));
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 6px;
  background: var(--sun); color: var(--sun-ink); text-decoration: none; white-space: nowrap;
  font: 700 15px/1 var(--display); box-shadow: 0 3px 0 var(--sun-lo), 0 8px 22px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.join:hover { transform: translateY(-1px); }
@media (max-width: 899px) { .join { right: 14px; min-height: 36px; padding: 0 13px; font-size: 14px; } }

/* ---------------------------------------------------------------- the chapters */
.story { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.ch {
  position: absolute; left: calc(var(--fl) + var(--edge)); top: 50%; width: min(540px, calc(var(--frame) * .4));
  transform: translateY(-50%);
  visibility: hidden;
}
.ch.on { visibility: visible; }
.ch.live { pointer-events: auto; }
.ch > * { opacity: var(--o, 0); transform: translateY(var(--y, 0)); filter: blur(var(--b, 0)); will-change: opacity, transform, filter; }
@media (max-width: 899px) {
  .ch { left: 20px; right: 20px; top: auto; bottom: max(28px, env(safe-area-inset-bottom)); width: auto; transform: none; }
}

.kick { margin: 0 0 16px; font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sun); text-shadow: 0 0 3px rgba(6, 10, 30, .9), 0 1px 10px rgba(6, 10, 30, .9); }
h1, h2 { margin: 0 0 18px; font-family: var(--display); font-weight: 700; letter-spacing: -.035em; text-wrap: balance; text-shadow: 0 2px 24px rgba(6, 10, 30, .45); }
h1 { font-size: clamp(36px, 4.4vw, 72px); line-height: .98; }
h2 { font-size: clamp(32px, 3.6vw, 58px); line-height: 1.02; }
em { font-style: normal; color: var(--sun); }
.lede { margin: 0; max-width: 30em; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; color: var(--text-2); text-shadow: 0 1px 14px rgba(6, 10, 30, .6); }
.lede b { color: var(--text); }
.hit { margin: 18px 0 0; padding-left: 14px; border-left: 3px solid var(--sun); font-size: clamp(18px, 1.5vw, 23px); line-height: 1.3; font-weight: 700; }
.big { font-size: clamp(56px, 7vw, 120px); line-height: .9; }
.big b { color: var(--sun); }
.rain { font-size: clamp(38px, 5vw, 84px); line-height: .98; }
.who { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.who img { width: 84px; height: 84px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); object-fit: cover; }
.who h2 { margin: 0; }
@media (max-width: 899px) { .who img { width: 64px; height: 64px; } .who { margin-bottom: 12px; } }
.learn { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; max-width: 30em; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.4; color: var(--text-2); text-shadow: 0 1px 14px rgba(6, 10, 30, .6); }
.learn li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.learn svg { width: 18px; height: 18px; margin-top: 4px; color: #8bd17c; }
.learn b { color: var(--text); }
/* the hosts, side by side on one screen */
.hosts { display: grid; gap: 14px; margin: 0 0 4px; max-width: 32em; }
.host { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; margin: 0; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.45; color: var(--text-2); text-shadow: 0 1px 14px rgba(6, 10, 30, .6); }
.host img { width: 64px; height: 64px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .35); object-fit: cover; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.host b { color: var(--text); }
.closer { margin: 18px 0 0; font: 400 13px/1.4 var(--mono); color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.ch .lede + .lede { margin-top: 10px; }
.gets { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; }
.gets li {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 8px 10px; border-radius: 999px;
  background: rgba(10, 14, 32, .55); border: 1px solid rgba(255, 255, 255, .25);
  font-size: 15px; font-weight: 700; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.gets svg { width: 16px; height: 16px; color: #8bd17c; }

.go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
  min-height: 58px; padding: 0 28px; border-radius: 6px;
  background: var(--sun); color: var(--sun-ink); text-decoration: none;
  font: 700 19px/1 var(--display); letter-spacing: -.01em;
  box-shadow: 0 5px 0 var(--sun-lo), 0 14px 34px rgba(255, 210, 63, .25);
  transition: transform .15s, box-shadow .15s;
}
.btn svg { width: 21px; height: 21px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--sun-lo), 0 18px 40px rgba(255, 210, 63, .35); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sun-lo); }
/* the footer: at the very bottom, with the last chapter only */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; margin: 0; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); text-align: center;
  font: 400 12px/1.5 var(--mono); color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
  background: linear-gradient(rgba(8, 11, 28, 0), rgba(8, 11, 28, .6));
  opacity: var(--fo, 0); pointer-events: none;
}
.foot.on { pointer-events: auto; }
.foot a { color: inherit; }
.foot a:hover { color: var(--sun); }
@media (max-width: 899px) { .ch:last-of-type { bottom: 58px; } }
.fine { font: 400 13px/1.4 var(--mono); color: var(--text-2); }
@media (min-width: 2000px) and (min-height: 1100px) {
  .ch { width: min(640px, calc(var(--frame) * .4)); }
  h1 { font-size: 88px; }
  h2 { font-size: 66px; }
  .rain { font-size: 96px; }
  .lede { font-size: 23px; }
  .kick { font-size: 14px; }
  .btn { min-height: 66px; padding: 0 34px; font-size: 22px; }
}
@media (max-width: 899px) {
  h1 { font-size: clamp(32px, 9vw, 44px); }
  h2 { font-size: clamp(28px, 8vw, 40px); margin-bottom: 12px; }
  .kick { margin-bottom: 12px; }
  .lede { font-size: 16.5px; }
  .hit { font-size: 18px; margin-top: 14px; }
  .big { font-size: 64px; }
  .rain { font-size: clamp(36px, 10vw, 48px); }
  .go { margin-top: 20px; }
  .btn { width: 100%; }
  .gets li { font-size: 14px; padding: 6px 10px 6px 8px; }
}

.hero-go { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 34px; }
.hero-go .more { margin-top: 0; }
.joe-note { margin: 22px 0 0; max-width: 30em; font: 400 13px/1.5 var(--mono); color: var(--text-2); text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.gets + .lede { margin-top: 0; }
.lede + .gets { margin-top: 18px; }
.skip-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none;
  font: 500 15px/1 var(--display); text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
  border-bottom: 1px solid rgba(255, 255, 255, .3); padding-bottom: 3px;
}
.skip-link svg { width: 15px; height: 15px; }
.skip-link:hover { color: var(--sun); border-color: var(--sun); }
@media (max-width: 899px) { .hero-go { margin-top: 20px; gap: 12px 22px; } .joe-note { margin-top: 14px; font-size: 12px; } }
/* "scroll down to learn more": a mouse whose wheel keeps rolling (a bouncing chevron on touch screens) */
.more {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 34px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.more:hover .more-t { color: var(--sun); }
.mouse { position: relative; width: 26px; height: 40px; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.mouse i { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--sun); animation: wheel 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(13px); opacity: 0; } 100% { opacity: 0; } }
@media (hover: none), (max-width: 899px) {
  .mouse { width: 22px; height: 22px; border: 0; border-radius: 0; box-shadow: none; }
  .mouse i { top: 0; left: 0; width: 14px; height: 14px; margin: 0 0 0 4px; border-radius: 0; background: none; border: solid var(--sun); border-width: 0 3px 3px 0; transform: rotate(45deg); animation: chev 1.4s ease-in-out infinite; }
  @keyframes chev { 0%, 100% { transform: translateY(0) rotate(45deg); opacity: .5; } 50% { transform: translateY(7px) rotate(45deg); opacity: 1; } }
  .more { margin-top: 22px; }
}

/* the scroll track: its height is set by JS, one screen per chapter */
.track { height: 1000vh; }

/* narrow screens are paged: nothing scrolls, and JS moves one chapter per swipe */
html.snap, html.snap body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.snap body { touch-action: none; }
html.snap .track { display: none; }
.t-swipe { display: none; }
html.snap .t-scroll { display: none; }
html.snap .t-swipe { display: inline; }
html.snap .mouse i { border-width: 3px 0 0 3px; margin-top: 6px; animation-name: chev-up; }
@keyframes chev-up { 0%, 100% { transform: translateY(0) rotate(45deg); opacity: .5; } 50% { transform: translateY(-7px) rotate(45deg); opacity: 1; } }
.count {
  display: none; position: fixed; z-index: 4; margin: 0; pointer-events: none;
  top: calc(max(22px, env(safe-area-inset-top)) + 26px); left: 20px; /* under the wordmark */
  font: 500 12px/1 var(--mono); letter-spacing: .1em; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.count b { font-weight: 500; color: var(--sun); }
.count i { font-style: normal; }
html.snap .count { display: block; }

/* ---------------------------------------------------------------- no JS: read it top to bottom */
html:not(.js) .story { position: static; }
html:not(.js) .ch { position: static; visibility: visible; transform: none; width: auto; max-width: 640px; margin: 0 auto; padding: 18vh 24px; }
html:not(.js) .ch > * { opacity: 1; }
html:not(.js) .scene[data-scene="nine"] { opacity: 1; }
html:not(.js) .joe-stage, html:not(.js) .track, html:not(.js) .alt, html:not(.js) .more, html:not(.js) .count { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* phones: this copy is long, so the type tightens, and tightens again on short screens */
@media (max-width: 899px) {
  .ch .lede { font-size: 15.5px; line-height: 1.42; }
  .ch .lede + .lede { margin-top: 8px; }
  .ch .hit { font-size: 16.5px; margin-top: 12px; }
  .ch h2 { font-size: clamp(25px, 7vw, 32px); }
  .ch h1 { font-size: clamp(30px, 8.6vw, 40px); }
  .learn { gap: 8px; font-size: 14.5px; line-height: 1.38; }
  .host { font-size: 14.5px; line-height: 1.38; grid-template-columns: 48px 1fr; gap: 10px; }
  .host img { width: 48px; height: 48px; }
  .hosts { gap: 10px; }
  .gets { gap: 6px; margin-bottom: 12px; }
  .gets li { font-size: 13px; padding: 5px 9px 5px 7px; }
  .hero-go { margin-top: 14px; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .joe-note { display: none; }
  .ch .kick { margin-bottom: 8px; }
  .ch h1, .ch h2 { margin-bottom: 10px; }
  .ch .lede { font-size: 14.5px; line-height: 1.38; }
  .ch .hit { font-size: 15.5px; }
  .learn { font-size: 13.5px; }
  .host { font-size: 13.5px; }
  .gets li { font-size: 12px; }
}
.joe-stage { transition: opacity .45s ease; }
@media (max-width: 899px) and (max-height: 600px) {
  .ch .lede { font-size: 14px; }
  .gets li { font-size: 11.5px; padding: 4px 8px 4px 6px; }
  .gets svg { width: 13px; height: 13px; }
}
@media (max-width: 899px) {
  .shade { transition: background .5s ease; }
  html.deep .shade { background: linear-gradient(180deg, rgba(8, 11, 28, .55) 0%, rgba(8, 11, 28, .78) 30%, rgba(8, 11, 28, .9) 100%); }
  html.deep .alt { opacity: 0; transition: opacity .4s; }
}
