/* The first screen: four watercolour worlds, wet paint that flows (js/wash.js), characters standing between the scene and
   the grass, weather and bouncing letters (see js/hero.js). No box, no frame: the paint fades straight into the page's paper. */

.hero {
  position: relative; height: clamp(34rem, 100svh, 58rem); overflow: hidden; isolation: isolate; background: transparent;
  --navy: #26282f; --halo: rgba(255, 251, 242, .92);
  /* pigments for the title letters; each also gets a bloom of paint for texture */
  --t0: #e2552f; --t1: #2f68cf; --t2: #e39a12; --t3: #2f9a63; --t4: #c63f7f; --t5: #6a4fc6;
}

/* ---------- worlds and their paint ---------- */
.wash { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease); }
.wash-back { z-index: 0; } .wash-fore { z-index: 2; }
.hero.gl .wash { opacity: 1; }
.hero.gl .lw { opacity: 0; transition: opacity 1s var(--ease); }
/* the bottom of the painting soaks into the page instead of stopping at an edge */
.wash, .lw { -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.worlds { position: absolute; inset: 0; z-index: 1; }
.world { position: absolute; inset: 0; visibility: hidden; z-index: 0; --wx: 50%; --wy: 92%; }
.world.leaving { visibility: visible; z-index: 1; }
.world.on { visibility: visible; z-index: 2; animation: wipe 1.4s var(--ease) both; }
@keyframes wipe { from { clip-path: circle(0 at var(--wx) var(--wy)); } to { clip-path: circle(150% at var(--wx) var(--wy)); } }
.lw { position: absolute; inset: 0; pointer-events: none; }
.lw.back { z-index: 0; } .lw.fore { z-index: 4; inset: 28% 0 -28% 0; }   /* sunk like SINK in hero.js */
@media (max-aspect-ratio: 1/1) { .lw.fore { inset: 6% 0 -6% 0; } }
.lyr { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; transform: scale(1.08); -webkit-user-drag: none; }
.lw.back .lyr { object-position: 50% 55%; }
.lw.fore .lyr { object-position: 50% 100%; }

/* a slow reveal when the page first opens: the paint soaks in */
.hero.intro .wash-back, .hero.intro .world.on .lw.back { animation: soak 2.6s var(--ease) both; }
.hero.intro .wash-fore, .hero.intro .world.on .lw.fore { animation: rise 1.8s var(--ease) .45s both; }
@keyframes soak { from { opacity: 0; transform: scale(1.12); filter: blur(14px) saturate(.6); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { transform: translateY(12%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- characters ---------- */
.troupe { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.who {
  position: absolute; height: var(--h); width: auto; pointer-events: auto; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transform: translateY(125%) rotate(var(--tilt, -4deg)); transform-origin: 50% 90%; transition: transform 1.2s var(--spring) var(--delay, .3s);
}
.world.on .who { transform: none; }
.world.leaving .who { transition: none; }
.who img { display: block; height: 100%; width: auto; pointer-events: none; transform-origin: 50% 96%; filter: drop-shadow(0 .9rem .7rem rgba(60, 40, 30, .22)); -webkit-user-drag: none; }
.who.hop { animation: hop .8s var(--spring); }
@keyframes hop { 35% { transform: translateY(-9%) scale(1.04, .98); } }
.who.held { cursor: grabbing; z-index: 9; }
.who.held img { filter: drop-shadow(0 2rem 1.2rem rgba(20, 8, 35, .4)); }
.who.l1, .who.r1 { --h: min(50vh, 26vw); bottom: 13vh; }
.who.l2, .who.r2 { --h: min(27vh, 15vw); bottom: 9vh; }
.who.l1 { left: 3%; --tilt: -8deg; --delay: .9s; } .who.r1 { right: 3%; --tilt: 8deg; --delay: 1.05s; }
.who.l2 { left: 25%; --tilt: 9deg; --delay: 1.2s; } .who.r2 { right: 25%; --tilt: -9deg; --delay: 1.3s; }
.bubble { position: absolute; z-index: 8; left: 50%; bottom: 82%; translate: -50% 0; white-space: nowrap; pointer-events: none; padding: .5rem .95rem; border-radius: 1.1rem; background: #fff; color: var(--navy); font-weight: 800; font-size: 1rem; box-shadow: 0 .5rem 1rem -.4rem rgba(20, 8, 35, .5); animation: bubble 1.9s var(--spring) both; }
.bubble::after { content: ""; position: absolute; left: 50%; top: 100%; width: .8rem; height: .8rem; background: #fff; transform: translate(-50%, -45%) rotate(45deg); border-radius: 0 0 .2rem 0; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(.8rem) scale(.5); } 14% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-.6rem); } }

/* ---------- weather and light ---------- */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.glow { position: absolute; left: 0; top: 0; width: 560px; height: 560px; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .5s; mix-blend-mode: soft-light;
  background: radial-gradient(circle, rgba(255, 244, 214, .7) 0, rgba(255, 244, 214, .2) 38%, transparent 66%); }

/* ---------- the words ---------- */
.hero-copy { position: absolute; z-index: 10; left: 50%; top: clamp(5.2rem, 13vh, 8rem); translate: -50% 0; width: min(96vw, 70rem); display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; }
.hero-copy > .badge, .hero-title, .hero-actions { pointer-events: auto; }
.badge { padding: .45rem 1.1rem; border-radius: 999px; background: rgba(255, 251, 242, .72); color: var(--navy); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero-title { margin: .8rem 0 0; font-family: var(--display); font-weight: 800; font-size: clamp(3.2rem, min(10.4vw, 18vh), 9.2rem); line-height: .9; letter-spacing: -.035em; }
.hero-title .row { display: block; }
.wd { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; cursor: pointer; animation: wave 4.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.23s); }
/* each letter is pigment: a solid colour with a bloom of paint laid over it, and a soft halo of bare paper around it */
.ch .in {
  display: inline-block; transform-origin: 50% 82%; color: transparent;
  background: var(--wc) 50% 50% / 260% auto, var(--c, #e2552f); background-blend-mode: multiply; -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 .03em var(--halo)) drop-shadow(0 .06em .12em rgba(60, 40, 30, .25));
}
.k0 .in { --c: var(--t0); --wc: url("../assets/watercolor/bloom-coral.webp"); } .k1 .in { --c: var(--t1); --wc: url("../assets/watercolor/bloom-sky.webp"); }
.k2 .in { --c: var(--t2); --wc: url("../assets/watercolor/bloom-butter.webp"); } .k3 .in { --c: var(--t3); --wc: url("../assets/watercolor/bloom-sage.webp"); }
.k4 .in { --c: var(--t4); --wc: url("../assets/watercolor/bloom-pink.webp"); } .k5 .in { --c: var(--t5); --wc: url("../assets/watercolor/bloom-lilac.webp"); }
@keyframes wave { 0%, 100% { transform: translateY(0) rotate(-1.4deg); } 50% { transform: translateY(-.04em) rotate(1.4deg); } }
.hero.intro .ch .in, .hero-title.drop .ch .in { animation: dropin 1s var(--spring) both; animation-delay: calc(var(--i, 0) * 48ms + .5s); }
.hero-title.drop .ch .in { animation-delay: calc(var(--i, 0) * 38ms + .15s); }
@keyframes dropin { from { transform: translateY(-190%) rotate(-24deg) scale(.5); opacity: 0; } 55% { opacity: 1; } to { transform: none; opacity: 1; } }
.ch:hover .in { animation: boing .75s var(--spring); }
.ch.pop .in { animation: pop .7s var(--spring); }
@keyframes boing { 30% { transform: translateY(-.24em) scale(1.12, .9) rotate(-7deg); } 62% { transform: translateY(0) scale(.94, 1.07) rotate(3deg); } }
@keyframes pop { 25% { transform: scale(1.55) rotate(10deg); } 60% { transform: scale(.9) rotate(-5deg); } }
.hero-line { margin: .9rem 0 0; font-size: clamp(1.05rem, 1.7vw, 1.4rem); font-weight: 750; color: var(--navy); text-shadow: 0 0 .3em var(--halo), 0 0 .8em var(--halo), 0 0 1.4em var(--halo); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .9rem; margin-top: 1.25rem; }
.hero-actions .btn-white { padding: 1rem 1.6rem; box-shadow: 0 .3rem 0 rgba(20, 8, 35, .25); }

/* the big yellow button: a dab of gamboge */
.cta { position: relative; overflow: hidden; padding: 1.05rem 2.3rem; border-radius: 999px; color: var(--navy); font-family: var(--body); font-weight: 850; font-size: clamp(1.1rem, 1.6vw, 1.3rem); letter-spacing: -.01em;
  background: url("../assets/watercolor/bloom-butter.webp") 50% 45% / 150% auto, #ffd45a; background-blend-mode: multiply;
  box-shadow: 0 1rem 1.8rem -.8rem rgba(150, 90, 10, .55); transition: transform .35s var(--spring), box-shadow .2s; animation: cta-bob 3.2s ease-in-out infinite 2.4s; }
.cta b { font-weight: 900; }
.cta:hover { transform: translateY(-5px) scale(1.06) rotate(-1.2deg); animation: none; }
.cta:active { transform: translateY(.15rem) scale(.98); box-shadow: 0 .5rem 1rem -.6rem rgba(150, 90, 10, .55); }
.cta::after { content: ""; position: absolute; top: -10%; bottom: -10%; width: 38%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent); transform: skewX(-18deg); animation: shine 4s ease-in-out infinite 2.6s; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes cta-bob { 50% { transform: translateY(-4px); } }

/* ---------- world orbs and sound ---------- */
.orbs { position: absolute; z-index: 12; left: 50%; bottom: 4.2rem; translate: -50% 0; display: flex; gap: 1.1rem; align-items: flex-end; }
.orb { position: relative; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--wc) 50% 50% / 135% auto; filter: saturate(1.15);
  transition: transform .45s var(--spring), filter .3s; animation: orbfloat 3.6s ease-in-out infinite; }
.orb:nth-child(2) { animation-delay: -.9s; } .orb:nth-child(3) { animation-delay: -1.8s; } .orb:nth-child(4) { animation-delay: -2.7s; }
.o-cozy { --wc: url("../assets/watercolor/bloom-peach.webp"); } .o-funny { --wc: url("../assets/watercolor/bloom-pink.webp"); }
.o-wondrous { --wc: url("../assets/watercolor/bloom-lilac.webp"); } .o-brave { --wc: url("../assets/watercolor/bloom-sky.webp"); }
.orb:hover { transform: translateY(-.3rem) scale(1.18) rotate(-6deg); }
.orb[aria-pressed="true"] { transform: translateY(-.2rem) scale(1.4); filter: saturate(1.5) contrast(1.1); }
.orb[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; top: calc(100% + .35rem); width: .32rem; height: .32rem; margin-left: -.16rem; border-radius: 50%; background: var(--navy); }
.orb-name { position: absolute; left: 50%; bottom: calc(100% + .7rem); translate: -50% .4rem; padding: .3rem .75rem; border-radius: 999px; background: rgba(255, 251, 242, .92); color: var(--navy); font-size: .82rem; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .25s, translate .35s var(--spring); }
.orb:hover .orb-name, .orb:focus-visible .orb-name, .orb[aria-pressed="true"] .orb-name { opacity: 1; translate: -50% 0; }
@keyframes orbfloat { 50% { translate: 0 -.3rem; } }
.snd { position: absolute; z-index: 12; right: clamp(1rem, 3vw, 2rem); bottom: 4.3rem; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 251, 242, .8); color: var(--navy); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .35s var(--spring); }
.snd:hover { transform: scale(1.12) rotate(-6deg); }
.snd[aria-pressed="true"] { background: url("../assets/watercolor/bloom-butter.webp") 50% 50% / 160% auto, #ffd45a; }
.snd svg { width: 1.3rem; height: 1.3rem; }
.hero :focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* ---------- short windows ---------- */
@media (max-height: 640px) and (min-aspect-ratio: 4/5) {
  .hero-copy { top: 4.3rem; }
  .hero-title { font-size: clamp(2.6rem, min(9vw, 17vh), 6rem); margin-top: .5rem; }
  .hero-line { display: none; }
  .hero-actions { margin-top: .9rem; }
  .who.l1, .who.r1 { --h: 52vh; } .who.l2, .who.r2 { --h: 22vh; }
}
@media (max-width: 1100px) and (min-aspect-ratio: 4/5) { .who.l2, .who.r2 { display: none; } }

/* ---------- phones and portrait tablets ---------- */
@media (max-width: 46rem), (max-aspect-ratio: 4/5) {
  .hero-copy { top: clamp(4.8rem, 10vh, 6.2rem); }
  .hero-title { font-size: clamp(3rem, 17.5vw, 7rem); margin-top: .6rem; }
  .hero-line { margin-top: .6rem; }
  .who.l1, .who.r1 { --h: min(37vh, 56vw); bottom: 14vh; }
  .who.l1 { left: -5%; } .who.r1 { right: -5%; }
  .who.l2, .who.r2 { --h: min(16vh, 25vw); bottom: 11vh; display: block; }
  .who.l2 { left: 26%; } .who.r2 { right: 26%; }
  .orbs { bottom: 3.5rem; gap: .9rem; } .orb { width: 2.8rem; height: 2.8rem; }
  .snd { bottom: 3.5rem; right: .9rem; width: 2.5rem; height: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .world.on, .hero.intro .world.on .lw, .cta, .cta::after, .orb, .ch, .ch .in, .who { animation: none !important; }
  .hero.intro .ch .in { animation: none !important; }
  .who { transform: none; transition: none; }
}
