/* Kuru 01 hero: maths with a patient little bird, on sun-yellow paper. The copy on the left; on the right Kuru sits in
   a tall arched window of cream paper (Kuru's stills are painted on that cream, #FFF4E4, so the window and the bird are
   one sheet; his loops have real alpha and play in the same place). Kuru is sized by width only: his files are
   re-rendered with new sizes (manifest.json), so nothing here depends on their shape or on the drawing inside. A pink sticky note gives the name.
   Shared Kuru figure styles (.ku__fig, .ku__still, .ku__loop) live here; the try section (02) uses them too. */

.ku { --ku-ink-2: #5A3A06; }
.kh { padding-top: clamp(40px, 5vw, 76px); --pk-fg-2: #5A3A06; }
.kh__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.kh__h { color: var(--ink); }
.kh__h1 { display: block; font: 800 clamp(42px, 5.4vw, 80px)/1.02 var(--font-display); letter-spacing: -.02em; }
.kh__h2 { display: block; margin-top: clamp(10px, 1.2vw, 16px); font: 800 clamp(21px, 2vw, 29px)/1.2 var(--font-display); color: #5A3A06; letter-spacing: -.005em; }
.kh__lead { margin-top: clamp(16px, 1.8vw, 22px); max-width: 33em; font: 600 var(--t-lead)/1.55 var(--font-body); color: var(--ink); }
.kh__points { margin-top: clamp(20px, 2.2vw, 28px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; font: 650 var(--t-body)/1.45 var(--font-body); color: var(--ink); }
.kh__points li::before { filter: drop-shadow(0 1px 0 rgba(90, 42, 0, .25)); }
.kh__actions { margin-top: clamp(24px, 2.6vw, 34px); display: flex; flex-wrap: wrap; gap: 12px 14px; }
.kh__btn { position: relative; }
.kh__small { margin-top: 16px; max-width: 32em; font: 700 var(--t-small)/1.5 var(--font-body); color: #5A3A06; }

/* the window: an arch of cream paper cut into the yellow, a little deeper than the page */
.kh__side { position: relative; justify-self: center; width: min(100%, 500px); }
.kh__window { position: relative; margin: 0; overflow: hidden; isolation: isolate; aspect-ratio: 500 / 640;
  border-radius: 50% 50% 18px 22px / 34% 34% 18px 22px; background: #FFF4E4;
  box-shadow: inset 0 6px 18px rgba(90, 42, 0, .26), inset 0 0 0 6px rgba(255, 255, 255, .45), 0 1px 1.5px rgba(90, 42, 0, .3), 0 26px 44px -24px rgba(90, 42, 0, .55); }
/* Kuru's figure is the clips' stage frame (560 x 618, see .ku__fig): wider than the window and cropped by it, so the bird
   (about half of the stage's width when he sits) fills the arch while his wave still clears its edges */

/* one grain over the window and the bird, so the cream paper and Kuru's painted paper read as one sheet */
.kh__grain, .kt__grain { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: url(/assets/art/textures/grain-tile.webp) 0 0 / 256px 256px; mix-blend-mode: multiply; opacity: .32; }
/* the note is stuck on the window's empty upper corner, never over Kuru (his cap starts about a quarter of the way down) */
.kh__name.pk-note { --pk-note-w: 13.5rem; --pk-tilt: -4deg; position: absolute; left: -16%; top: auto; bottom: -7%; z-index: 4; min-height: 0; font: 700 17.5px/1.35 var(--font-display); }
.kh__name b { display: block; font-weight: 800; }

/* ---------- a Kuru figure: the still, with the loops stacked on it once they can play (_player.js)
   The box is always the clips' shared stage frame (560 x 618), whatever still is showing. The stills are cut tight and
   drawn bigger, so each one is placed in that frame where its own clip draws the same pose (_player.js REG; the markup
   carries the first still's place inline). A pose change or a clip taking over never resizes or moves Kuru. */
.ku__fig { position: relative; aspect-ratio: 1 / 1; transform-origin: 50% 92%; }
.ku__fig .ku__still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; max-width: none; filter: drop-shadow(0 16px 16px rgba(90, 42, 0, .22)); }
.ku__fig .ku__loop { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; object-fit: cover; pointer-events: none; transition: opacity .3s var(--ease-glide); border-radius: inherit; }
.ku__fig .ku__loop.is-on { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .ku__fig.is-swap .ku__still { animation: ku-swap 320ms var(--ease-settle); }
}
@keyframes ku-swap { 0% { transform: scale(.94) translateY(6px); opacity: .6; } 100% { transform: none; opacity: 1; } }

@media (min-width: 900px) and (max-width: 1279.98px) {
  .kh__name.pk-note { left: -8%; top: -7%; bottom: auto; }
}
@media (max-width: 1099.98px) {
  .kh__points { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899.98px) {
  .kh__grid { grid-template-columns: minmax(0, 1fr); }
  .kh__side { width: min(82%, 380px); order: -1; }
  .kh__name.pk-note { left: auto; right: -20%; top: -5%; bottom: auto; --pk-note-w: 12rem; --pk-tilt: 4deg; font-size: 16.5px; }
}
@media (max-width: 479.98px) {
  .kh__side { width: 74%; justify-self: start; margin-left: 4%; }
  .kh__name.pk-note { right: -17%; top: -9%; bottom: auto; --pk-note-w: 9.8rem; font-size: 15px; padding: 1.2em .9em .9em; }
  .kh__actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ku__fig { animation: none !important; }
}
@media (forced-colors: active) {
  .kh__window { border: 2px solid CanvasText; }
}
.kh__small a { color: var(--blue-deep); font-weight: 800; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 2px; }

/* R5: Kuru, live in 3D (static picture first) */
.kh__toy3d { width: 100%; --toy-ar: 1 / 1; }
