/* The landing page after the first screen, after zenda.com. Sections carry data-scrub: motion.js gives each one
   --p, its smoothed progress up the screen (0 → 1), and everything here is drawn from that number, so things
   move with the scroll and settle a beat after it, as zenda's GSAP `scrub: 1` timelines do. */

.home { overflow-x: clip; }
.home section { position: relative; }

/* section headings rise and fade in with the scroll; --sp is how fast, --o how late */
.rise {
  --q: clamp(0, var(--p, 1) * var(--sp, 2.6) - var(--o, 0), 1);
  --e: calc(1 - (1 - var(--q)) * (1 - var(--q)));
  translate: 0 calc((1 - var(--e)) * 7rem); opacity: var(--e);
}
.tabs.rise { --o: .35; }
.sec-h { text-align: center; font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.12; max-width: 17ch; margin: 0 auto; font-variation-settings: "SOFT" 60, "WONK" 0.5, "opsz" 48; letter-spacing: -.03em; }

/* ---------- the crew flies in (zenda's "features": chips converge on the phone) ---------- */
.feat { padding: clamp(5rem, 12vh, 9rem) clamp(1.25rem, 4vw, 4rem) clamp(4rem, 10vh, 7rem); }
.feat-stage { --m: 1; position: relative; width: min(72rem, 100%); height: clamp(30rem, 44vw, 38rem); margin: clamp(2rem, 5vw, 4rem) auto 0; }
.feat-core {
  --e: calc(1 - (1 - var(--p, 1)) * (1 - var(--p, 1)));
  position: absolute; left: 50%; top: 50%; width: clamp(15rem, 30vw, 25rem); aspect-ratio: 1; translate: -50% -50%;
  scale: calc(1.5 - .5 * var(--e));
}
.feat-core .disc { position: absolute; inset: 0; border-radius: 50%; background: var(--lilac); }
.feat-core .core-img { position: absolute; left: 6%; bottom: 4%; width: 88%; height: auto; }
.flys { list-style: none; margin: 0; padding: 0; }
.fly {
  --dur: 1; --x: -30rem; --y: -6rem; --r: -10deg; --s: 1.15;
  --q: clamp(0, var(--p, 1) / var(--dur), 1);
  --e: calc(1 - (1 - var(--q)) * (1 - var(--q)) * (1 - var(--q)));
  position: absolute; display: inline-flex; align-items: center; gap: .6rem; padding: .35rem 1.2rem .35rem .35rem; border-radius: 999px; background: var(--card);
  font-weight: 500; font-size: 1.05rem; letter-spacing: -.03em; white-space: nowrap;
  transform: translate(calc(var(--x) * var(--m) * (1 - var(--e))), calc(var(--y) * (1 - var(--e)))) rotate(calc(var(--r) * (1 - var(--e)))) scale(calc(1 + (var(--s) - 1) * (1 - var(--e))));
  will-change: transform;
}
.fly-pic { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; background: var(--paper); overflow: hidden; }
.fly-pic img { width: 88%; height: 88%; object-fit: contain; }
/* where each chip ends up, and where it starts from (zenda's own offsets: ±26–46rem across, a little above, tilted) */
.fly.c1 { left: 12%; top: 4%; --dur: .67; --x: -26rem; --y: -12rem; --r: -20deg; --s: 1.2; }
.fly.c3 { left: 2%; top: 28%; --dur: .75; --x: -28rem; --y: -4rem; --r: -8deg; }
.fly.c5 { left: 9%; top: 52%; --dur: .75; --x: -30rem; --y: -5rem; --r: -12deg; --s: 1.1; }
.fly.c7 { left: 0; top: 76%; --dur: .84; --x: -34rem; --y: -3rem; --r: -6deg; --s: 1.25; }
.fly.c9 { left: 19%; top: 92%; --dur: 1; --x: -40rem; --y: -5rem; --r: -7deg; --s: 1.18; }
.fly.c2 { right: 13%; top: 0; --dur: .67; --x: 26rem; --y: -12rem; --r: 18deg; --s: 1.2; }
.fly.c4 { right: 1%; top: 24%; --dur: .75; --x: 28rem; --y: -4rem; --r: 8deg; }
.fly.c6 { right: 8%; top: 48%; --dur: .75; --x: 30rem; --y: -5rem; --r: 12deg; --s: 1.1; }
.fly.c8 { right: 0; top: 72%; --dur: .84; --x: 34rem; --y: -3rem; --r: 6deg; --s: 1.25; }
.fly.c10 { right: 18%; top: 90%; --dur: 1; --x: 40rem; --y: -6rem; --r: 9deg; --s: 1.2; }
.feat .feat-go { text-align: center; margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; --o: .9; --sp: 2.4; }

/* ---------- the thirty places under a drawn arc (zenda's "rewards" dome) ---------- */
.worlds { padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 4vw, 4rem) clamp(4rem, 10vh, 7rem); text-align: center; }
.dome {
  --q: clamp(0, var(--p, 1) * 1.4, 1);
  --e: calc(1 - (1 - var(--q)) * (1 - var(--q)));
  position: relative; width: min(64rem, 100%); aspect-ratio: 1000 / 520; margin: clamp(2rem, 5vw, 3.5rem) auto 0;
}
.dome::before {
  content: ""; position: absolute; left: 2%; right: 2%; top: 7.7%; bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(to bottom, var(--paper-2), var(--paper) 92%); translate: 0 calc((1 - var(--e)) * 30%); opacity: calc(.2 + var(--e));
}
.arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arc path { fill: none; stroke: var(--purple); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--q)); }
.spark { position: absolute; width: 1.6rem; color: var(--purple); scale: var(--q, 1); }
.spark svg { display: block; width: 100%; fill: currentColor; }
.dome .s1 { left: 9%; top: 22%; } .dome .s2 { right: 12%; top: 12%; width: 1.1rem; color: var(--pink); }
.stage { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.blob { position: relative; width: 66%; margin-bottom: 1%; translate: 0 calc((1 - var(--e)) * 38%); }
.pl-art { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; animation: drift 9s ease-in-out infinite; }
.round {
  position: absolute; bottom: 8%; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--card); color: var(--ink);
  transition: transform .45s var(--spring), background-color .2s var(--ease-col), color .2s var(--ease-col); z-index: 2;
}
.round svg { width: 1.3rem; height: 1.3rem; }
.round:hover { transform: scale(1.1); background: var(--ink); color: #fff; }
.round.prev { left: 3%; } .round.next { right: 3%; }
.pl-name { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.03em; margin: 1.6rem 0 .3rem; font-variation-settings: "SOFT" 55, "WONK" 0.4, "opsz" 36; }
.pl-desc { margin: 0 auto; max-width: 34ch; color: var(--ink-soft); font-size: 1.1rem; }
.pl-go { margin: 1.6rem 0 0; }
/* stepping through the places */
.worlds.out-l .blob img, .worlds.out-l .pl-name, .worlds.out-l .pl-desc { animation: out-l .34s var(--ease) forwards; }
.worlds.out-r .blob img, .worlds.out-r .pl-name, .worlds.out-r .pl-desc { animation: out-r .34s var(--ease) forwards; }
.worlds.in-r .blob img, .worlds.in-r .pl-name, .worlds.in-r .pl-desc { animation: in-r .8s var(--ease) both; }
.worlds.in-l .blob img, .worlds.in-l .pl-name, .worlds.in-l .pl-desc { animation: in-l .8s var(--ease) both; }
@keyframes out-l { to { opacity: 0; transform: translateX(-12%) scale(.94); } }
@keyframes out-r { to { opacity: 0; transform: translateX(12%) scale(.94); } }
@keyframes in-r { from { opacity: 0; transform: translateX(12%) scale(.94); } }
@keyframes in-l { from { opacity: 0; transform: translateX(-12%) scale(.94); } }

/* ---------- the stories: white rounded cards rising a row at a time ---------- */
.shelf { max-width: 84rem; margin: 0 auto; padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 4vw, 4rem) clamp(3rem, 8vh, 5rem); scroll-margin-top: 1rem; }
.shelf-head { text-align: center; margin-bottom: clamp(2rem, 4vw, 3rem); }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: 1.8rem; }
.tab { padding: .6rem 1.25rem; border-radius: 999px; background: var(--card); font-weight: 500; font-size: 1rem; letter-spacing: -.02em; transition: transform .45s var(--spring), background-color .2s var(--ease-col), color .2s var(--ease-col); }
.tab:hover { transform: scale(1.05); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tab.own { background: var(--purple-btn); color: #fff; }
.tab.own:hover { background: var(--purple-btn-2); }
.books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.book {
  display: flex; flex-direction: column; gap: .6rem; width: 100%; height: 100%; padding: 1.1rem 1.1rem 1.4rem; border-radius: var(--r-l); background: var(--card);
  transition: transform .45s var(--spring);
}
.book-art { display: block; aspect-ratio: 3 / 2; }
.book-art img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--spring); }
.book-title { font-family: var(--display); font-weight: 500; font-size: 1.15rem; line-height: 1.2; letter-spacing: -.025em; padding: 0 .2rem; font-variation-settings: "SOFT" 50, "WONK" 0.3, "opsz" 24; }
.book:hover { transform: scale(1.025); }
.book:hover .book-art img { transform: translateY(-.5rem) scale(1.05); }
.rv { opacity: 0; transform: translateY(4rem); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease); transition-delay: calc(var(--k, 0) * 90ms); }
.rv.in { opacity: 1; transform: none; }
.more { text-align: center; margin: 2.4rem 0 0; }

/* ---------- the dark panel to finish ---------- */
.cta { padding: clamp(5rem, 12vh, 8rem) clamp(1rem, 3vw, 3rem) clamp(2rem, 5vh, 4rem); }
.cta-panel {
  --q: clamp(0, var(--p, 1) * 1.6, 1);
  --e: calc(1 - (1 - var(--q)) * (1 - var(--q)) * (1 - var(--q)));
  position: relative; max-width: 80rem; margin: 0 auto; padding: clamp(6rem, 11vw, 8rem) 1.5rem clamp(3.5rem, 7vw, 5rem); border-radius: var(--r-xl);
  background: var(--dark); color: #fff; text-align: center; scale: calc(.86 + .14 * var(--e)); opacity: calc(.3 + .7 * var(--e));
}
.cta-art { position: absolute; left: 50%; top: 0; width: clamp(8rem, 14vw, 11rem); translate: -50% -48%; }
.cta-img { display: block; width: 100%; height: auto; animation: bob-a 5s ease-in-out infinite; }
.cta-art .spark { color: #fff; }
.cta-art .s1 { left: -40%; top: 40%; } .cta-art .s2 { right: -30%; top: 18%; width: 1.1rem; color: var(--blue); } .cta-art .s3 { right: -55%; top: 66%; width: .9rem; color: var(--pink-2); }
.cta-h { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.5rem); margin: 0 auto 2rem; translate: 0 calc((1 - var(--e)) * 3rem); font-variation-settings: "SOFT" 55, "WONK" 0.5, "opsz" 48; }

/* ---------- footer: rounded tabs on a soft panel ---------- */
.site-footer { position: relative; max-width: 84rem; margin: clamp(3rem, 8vh, 5rem) auto 0; padding: 0 clamp(1rem, 3vw, 3rem); overflow: hidden; }
.foot-tabs { display: flex; gap: .35rem; padding-left: clamp(1.2rem, 3vw, 2.4rem); }
.ft {
  display: inline-flex; align-items: center; min-height: 3rem; padding: .7rem 1.4rem .6rem; border-radius: 20px 20px 0 0; background: var(--paper-3);
  font-weight: 500; font-size: 1rem; letter-spacing: -.02em; text-decoration: none; transition: background-color .2s var(--ease-col), color .2s var(--ease-col), padding .45s var(--spring);
}
.ft:hover { background: var(--purple-btn); color: #fff; padding-bottom: .9rem; margin-top: -.3rem; }
.foot-panel { border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--paper-3); padding: clamp(2rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.4rem) 1.6rem; }
.foot-word { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(3.6rem, 15vw, 13rem); line-height: .9; letter-spacing: -.05em; color: var(--purple); font-variation-settings: "SOFT" 40, "WONK" 0.6, "opsz" 144; }
.foot-word b { font-weight: 600; } .foot-word i { font-style: normal; color: var(--magenta); }
.foot-line { margin: 1.4rem 0 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- phones ---------- */
@media (max-width: 46rem) {
  .feat-stage { --m: .42; height: 34rem; }
  .feat-core { width: 13rem; }
  .fly { font-size: .9rem; padding: .25rem .9rem .25rem .25rem; gap: .4rem; }
  .fly-pic { width: 2.3rem; height: 2.3rem; }
  .fly.c1 { left: 2%; top: 1%; } .fly.c2 { right: 2%; top: 7%; }
  .fly.c3 { left: 0; top: 18%; } .fly.c4 { right: 0; top: 24%; }
  .fly.c5, .fly.c6 { display: none; }
  .fly.c7 { left: 0; top: 72%; } .fly.c8 { right: 0; top: 78%; }
  .fly.c9 { left: 6%; top: 89%; } .fly.c10 { right: 6%; top: 95%; }
  .dome { width: 116%; margin-left: -8%; }
  .blob { width: 74%; }
  .round { width: 2.9rem; height: 2.9rem; bottom: 0; }
  .round.prev { left: 6%; } .round.next { right: 6%; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .book { padding: .7rem .7rem 1rem; border-radius: var(--r-m); }
  .book-title { font-size: 1rem; }
  .ft { padding: .6rem 1rem .5rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .fly, .feat-core, .dome, .cta-panel { --p: 1 !important; }
  .rv { opacity: 1; transform: none; }
}

/* Scrubbed layers get their own compositor layer so scroll only re-composites, never re-rasterises the art. */
@media (prefers-reduced-motion: no-preference) {
  .rise, .feat-core, .blob, .dome::before, .cta-panel, .cta-h { will-change: translate, scale, opacity; }
}
@media (max-width: 46rem) { .feat { padding-top: 1.5rem; } }

/* ---- paper cut-outs: a thin paper rim and a soft shadow that deepens as the piece lifts ---- */
.pl-art, .feat-core .core-img, .cta-art img {
  filter: drop-shadow(2px 0 0 #fffdf6) drop-shadow(-2px 0 0 #fffdf6) drop-shadow(0 2px 0 #fffdf6) drop-shadow(0 -2px 0 #fffdf6)
          drop-shadow(0 .9rem 1rem rgba(64, 44, 110, .2));
}
.feat-core .disc { box-shadow: 0 1.2rem 2.4rem -1rem rgba(64, 44, 110, .25), inset 0 0 0 3px rgba(255, 253, 246, .9); }
.book-art img { filter: drop-shadow(0 .35rem .45rem rgba(64, 44, 110, .16)); transition: transform .6s var(--spring), filter .6s var(--ease); }
.book:hover .book-art img { filter: drop-shadow(0 1rem 1rem rgba(64, 44, 110, .22)); }
.fly { filter: drop-shadow(0 .5rem .8rem rgba(64, 44, 110, .14)); }
