/* ==========================================================================
   Lengai Lodge — home page "wow": living sunset, beaded collar, shuka waves,
   walking herds, shield cards, night fire and the jump game
   ========================================================================== */

/* ---------- Living sunset hero ---------- */
.hero--living .hero__sunset {
	position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
	background: linear-gradient(180deg, #FFE3BC 0%, #FBD3A6 45%, #EFB386 75%, #C98663 100%);
	opacity: .85;
}
.hero__sun {
	position: absolute; left: 78%; top: 20%; width: clamp(160px, 26vmin, 300px); aspect-ratio: 1; border-radius: 50%;
	transform: translate(-50%, -50%); pointer-events: none;
	background: radial-gradient(circle, rgba(255,244,210,.85) 0 22%, rgba(255,226,160,.4) 30% 42%, rgba(255,190,110,.12) 55%, rgba(255,170,90,0) 70%);
	mix-blend-mode: screen; animation: sun-breathe 6s ease-in-out infinite alternate;
}
@keyframes sun-breathe { to { scale: 1.08; } }
.hero__clouds { position: absolute; inset: 0 0 40%; pointer-events: none; overflow: hidden; }
.hero__clouds span {
	position: absolute; left: 0; height: 26px; border-radius: 50%; opacity: .55; filter: blur(6px);
	background: linear-gradient(90deg, rgba(255,236,210,0), rgba(255,236,210,.9) 30% 70%, rgba(255,236,210,0));
	animation: cloud-drift 90s linear infinite;
}
.hero__clouds span:nth-child(1) { top: 14%; width: 340px; animation-delay: -10s; }
.hero__clouds span:nth-child(2) { top: 24%; width: 220px; height: 18px; animation-duration: 120s; animation-delay: -60s; }
.hero__clouds span:nth-child(3) { top: 8%;  width: 420px; height: 30px; animation-duration: 140s; animation-delay: -95s; opacity: .4; }
.hero__clouds span:nth-child(4) { top: 32%; width: 260px; height: 16px; animation-duration: 100s; animation-delay: -30s; }
@keyframes cloud-drift { from { transform: translateX(-450px); } to { transform: translateX(calc(100vw + 450px)); } }

.hero__layer { position: absolute; left: -4%; bottom: 0; width: 108%; height: 78%; pointer-events: none; transition: translate .1s linear; }
.hero__volcano { height: 58%; opacity: .5; mix-blend-mode: multiply; }
.hero__hills { height: 42%; }
.hero__ground { height: 34%; }
.hv-glow { transform-box: fill-box; transform-origin: center; animation: crater-glow 2.8s ease-in-out infinite alternate; }
@keyframes crater-glow { from { opacity: .45; } to { opacity: 1; transform: scale(1.3, 1.15); } }
.hv-smoke circle { transform-box: fill-box; transform-origin: center; opacity: 0; animation: hv-smoke 9s ease-out infinite; }
.hv-smoke circle:nth-child(2) { animation-delay: -3s; }
.hv-smoke circle:nth-child(3) { animation-delay: -6s; }
@keyframes hv-smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: .32; } 100% { opacity: 0; transform: translate(70px, -150px) scale(3.4); } }

.hero__parade {
	position: absolute; left: 0; right: 0; bottom: 3.6%; height: clamp(44px, 7vh, 70px);
	color: #1E110C; pointer-events: none; transition: translate .1s linear;
}
/* Hero text sits above all painted layers */
.hero--living .hero__content, .hero--living .hero__dots { z-index: 3; }
.hero--living::after { z-index: 2; background: linear-gradient(90deg, rgba(20,12,8,.62), rgba(20,12,8,.1) 55%, transparent), linear-gradient(0deg, rgba(20,12,8,.55), transparent 35%); }

/* ---------- Walking herds (silhouettes) ---------- */
.parade { height: 100%; overflow: hidden; }
.parade__track { display: flex; width: max-content; height: 100%; animation: parade-walk 95s linear infinite; }
.parade__track svg { height: 100%; width: auto; flex: none; overflow: visible; }
@keyframes parade-walk { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.pw-fill { fill: currentColor; }
.pw-leg path, .pw-stick, .pw-horn { stroke: currentColor; fill: none; stroke-linecap: round; }
.pw-leg path { stroke-width: 4.5; }
.pw-stick { stroke-width: 2.4; }
.pw-horn { stroke-width: 2.6; }
.pw-leg { transform-box: fill-box; transform-origin: 50% 0; animation: pw-step .55s ease-in-out infinite alternate; }
.pw-leg--b { animation-direction: alternate-reverse; }
@keyframes pw-step { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }

/* ---------- Welcome: the giant beaded collar ---------- */
.welcome { position: relative; overflow: hidden; padding-bottom: 0; }
.welcome__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.collar { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1; margin-inline: auto; }
.collar__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 2px rgba(42,20,10,.28)); }
.collar__beads { transform-box: view-box; transform-origin: 320px 320px; }
.collar.is-built .collar__beads { animation: collar-sway 9s ease-in-out 3.5s infinite alternate; }
@keyframes collar-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.collar circle { opacity: 0; transform: scale(0); transform-box: fill-box; transform-origin: center; }
.collar.is-built circle {
	opacity: 1; transform: none;
	transition: opacity .2s ease var(--d, 0s), transform .45s cubic-bezier(.2,1.8,.4,1) var(--d, 0s);
}
.collar__center {
	position: absolute; inset: 22%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
	text-align: center; padding: 0 4%;
	background: radial-gradient(circle, #FFFCF8 0 60%, #F2E9E0 100%);
	box-shadow: inset 0 0 0 3px rgba(176,24,42,.15), inset 0 8px 30px rgba(120,60,30,.12);
}
.collar__karibu { font-family: var(--serif); font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1; color: var(--shuka); margin: 0 0 .35rem; }
.collar__title { font-size: clamp(1.1rem, 2vw, 1.7rem); line-height: 1.15; margin: 0 0 .6rem; max-width: 14ch; }
.collar__since { font-size: .9rem; color: var(--muted); margin: 0; }
.welcome__text p { max-width: 58ch; color: #433A35; }
.welcome__text .facts { grid-template-columns: 1fr 1fr; margin-bottom: 1.75rem; }
.welcome__photo { margin: 0; }
.welcome__photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.parade-strip { height: 64px; margin-top: clamp(2.5rem, 6vw, 4.5rem); color: rgba(42,35,32,.22); }

/* ---------- Waving shuka dividers ---------- */
.shuka-wave { position: relative; z-index: 4; height: 64px; margin: -32px 0; pointer-events: none; }
.shuka-wave__cloth {
	position: absolute; inset: 0;
	background-color: #B0182A;
	background-image:
		linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.2) 120px, rgba(255,255,255,0) 240px, rgba(0,0,0,.32) 360px, rgba(0,0,0,0) 480px),
		repeating-linear-gradient(90deg, transparent 0 34px, rgba(30,8,10,.32) 34px 46px, transparent 46px 52px, rgba(31,79,156,.6) 52px 54px, transparent 54px 88px),
		repeating-linear-gradient(0deg, transparent 0 10px, rgba(30,8,10,.32) 10px 22px, transparent 22px 26px, rgba(31,79,156,.6) 26px 28px, transparent 28px 44px);
	background-size: 480px 100%, auto, auto;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='64'%3E%3Cpath d='M0 16 Q120 0 240 16 T480 16 L480 48 Q360 64 240 48 T0 48Z'/%3E%3C/svg%3E") 0 0 / 480px 64px repeat-x;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='64'%3E%3Cpath d='M0 16 Q120 0 240 16 T480 16 L480 48 Q360 64 240 48 T0 48Z'/%3E%3C/svg%3E") 0 0 / 480px 64px repeat-x;
	animation: shuka-ripple 4.5s linear infinite;
	filter: drop-shadow(0 6px 6px rgba(0,0,0,.25));
}
.shuka-wave--blue .shuka-wave__cloth { background-color: #2552B8; }
@keyframes shuka-ripple {
	to { -webkit-mask-position: 480px 0; mask-position: 480px 0; background-position: 480px 0, 0 0, 0 0; }
}

/* ---------- Maasai shield cards ---------- */
.shield-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2.5rem); justify-items: center; }
.shield-grid > li { width: 100%; max-width: 250px; animation: shield-sway 6s ease-in-out infinite alternate; }
.shield-grid > li:nth-child(2n) { animation-delay: -2s; }
.shield-grid > li:nth-child(3n) { animation-delay: -4s; }
@keyframes shield-sway { from { transform: rotate(-2deg) translateY(0); } to { transform: rotate(2deg) translateY(-6px); } }
.shield-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #fff; perspective: 1100px; }
.shield-card:hover { color: #fff; }
.shield-card__inner {
	position: relative; display: block; width: 100%; aspect-ratio: 200 / 320;
	transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.shield-card:focus-visible { outline: none; }
.shield-card:focus-visible .shield-card__title { outline: 3px solid var(--bead-yellow); outline-offset: 4px; }
@media (hover: hover) {
	.shield-card:hover .shield-card__inner, .shield-card:focus-visible .shield-card__inner { transform: rotateY(180deg); }
}
.shield-card__face { position: absolute; inset: 0; display: block; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.shield-card__front svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 20px 22px rgba(0,0,0,.5)); }
.shield-card__back { transform: rotateY(180deg); clip-path: ellipse(46% 47.5% at 50% 50%); background: var(--basalt-2); }
.shield-card__photo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.shield-card__back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,12,8,.1) 20%, rgba(20,12,8,.85) 80%); }
.shield-card__text { position: absolute; inset: auto 12% 16%; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
.shield-card__tagline { font-size: .92rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.shield-card__more { font-weight: 700; font-size: .9rem; background: var(--shuka); padding: .35rem .9rem; border-radius: 999px; }
.shield-card__title { margin-top: 1.1rem; font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; text-align: center; }
.shield-card__title::after {
	content: ""; display: block; height: 6px; width: 60px; margin: .55rem auto 0;
	background: url("../img/beads.svg") repeat-x left center / auto 6px; transition: width .4s ease;
}
.shield-card:hover .shield-card__title::after { width: 110px; }

/* ---------- Night by the fire ---------- */
.night {
	position: relative; overflow: hidden; overflow: clip; color: #E9E1DB;
	background: linear-gradient(180deg, #0A0D1E 0%, #16132C 45%, #2B1612 100%);
	padding-top: var(--section);
}
.night__sky { position: absolute; inset: 0; pointer-events: none; }
.night__stars span { position: absolute; border-radius: 50%; background: #FFF8E8; animation: twinkle var(--tw, 3s) ease-in-out var(--td, 0s) infinite alternate; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }
.night__moon {
	position: absolute; right: 12%; top: 12%; width: 64px; height: 64px; border-radius: 50%;
	box-shadow: inset 14px -6px 0 0 #F4E9C8, 0 0 50px rgba(244,233,200,.18);
}
.night__grid { position: relative; display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; align-items: end; }
.night__text { padding-bottom: clamp(3rem, 8vw, 6rem); }
.night__text .section-title { color: #fff; }
.night__text p { color: #D6CDC7; max-width: 46ch; }
.night__scene { position: relative; }
.night__svg { display: block; width: 100%; height: auto; overflow: visible; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .42s ease-in-out infinite alternate; }
.flame--2 { animation-duration: .31s; animation-delay: -.2s; }
.flame--3 { animation-duration: .25s; animation-delay: -.1s; }
@keyframes flicker {
	0%   { transform: scale(1, 1) skewX(0deg); }
	50%  { transform: scale(.9, 1.1) skewX(4deg); }
	100% { transform: scale(1.06, .92) skewX(-4deg); }
}
.fire-glow { transform-box: fill-box; transform-origin: center; animation: glow-flicker 1.6s ease-in-out infinite alternate; }
@keyframes glow-flicker { from { opacity: .7; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
.teller-arm { transform-box: view-box; transform-origin: 456px 238px; animation: storytell 2.6s ease-in-out infinite; }
@keyframes storytell { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-24deg); } 60% { transform: rotate(8deg); } }
.sitter--back { animation: nod 4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes nod { 50% { transform: rotate(2deg); } }
.sparks { position: absolute; left: 0; right: 0; bottom: 17%; height: 70%; pointer-events: none; }
.sparks span {
	position: absolute; bottom: 0; width: 3px; height: 3px; border-radius: 50%; background: #FFC45A;
	box-shadow: 0 0 6px 2px rgba(255,150,50,.7); opacity: 0;
	animation: spark var(--sd, 2.5s) linear var(--sdl, 0s) infinite;
}
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--sx, 0), -240px); } }

/* ---------- Jump with the Maasai ---------- */
.jump { background: var(--ash); }
.jump__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.jump__text p { max-width: 50ch; color: #433A35; }
.jump__scores { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0 1rem; max-width: 360px; }
.jump__scores div { background: var(--paper); border-radius: var(--radius); padding: .9rem 1.1rem; border-top: 5px solid var(--shuka); }
.jump__scores div + div { border-top-color: var(--bead-blue); }
.jump__scores dt { font-size: .9rem; color: var(--muted); }
.jump__scores dd { margin: .15rem 0 0; font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.jump__msg { min-height: 3em; font-weight: 500; }
.jump__btn { font-size: 1.15rem; padding: 1.05rem 2rem; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.jump__btn:active { transform: scale(.97); }

.jump__stage {
	position: relative; height: 480px; border-radius: 18px; overflow: hidden; border: 6px solid transparent;
	background-image: linear-gradient(180deg, #FBD79E 0%, #F2A461 55%, #D8703F 100%), url("../img/beads.svg");
	background-origin: border-box; background-clip: padding-box, border-box;
	box-shadow: 0 24px 50px rgba(42,35,32,.2);
	--crouch: 0px; --jump: 0; --jdur: 1000ms;
}
.jump__ruler { position: absolute; inset: 0; pointer-events: none; }
.jump__ruler span {
	position: absolute; left: 0; right: 0; bottom: calc(47px + var(--cm) * 1.8px);
	border-top: 2px dashed rgba(90,40,20,.25); padding: 2px 0 0 12px; font-size: .78rem; font-weight: 700; color: rgba(90,40,20,.6);
}
.jump__ground { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(180deg, #9A5A34, #7A4428); }
.jump__ground::before {
	content: ""; position: absolute; left: 50%; top: -6px; width: 80px; height: 12px; margin-left: -40px; border-radius: 50%;
	background: rgba(0,0,0,.3);
}
.jump__hero { position: absolute; bottom: 42px; left: 50%; width: 90px; height: 180px; margin-left: -45px; z-index: 2; transform: translateY(var(--crouch)); }
.jump__hero .mz-shadow, .jump__crowd .mz-shadow { display: none; }
.jump__hero svg, .jump__crowd svg { width: 100%; height: 100%; display: block; }
.jump__stage.is-jumping .jump__hero { animation: jump-arc var(--jdur) linear forwards; }
.jump__stage.is-jumping .jump__ground::before { animation: jump-shadow var(--jdur) linear forwards; }
@keyframes jump-arc {
	0%   { transform: translateY(0); animation-timing-function: cubic-bezier(.2,.7,.4,1); }
	50%  { transform: translateY(calc(var(--jump) * -1.8px)); animation-timing-function: cubic-bezier(.6,0,.8,.3); }
	100% { transform: translateY(0); }
}
@keyframes jump-shadow { 50% { transform: scale(.4); opacity: .3; } }
.jump__crowd { position: absolute; bottom: 42px; width: 70px; height: 140px; z-index: 1; }
.jump__crowd--l { left: 16%; }
.jump__crowd--r { right: 16%; }
.jump__crowd .mz-all { animation: mz-bob 1.2s ease-in-out infinite alternate; }
.jump__stage.is-charging .jump__crowd .mz-arm--l { animation: mz-clap-l .28s ease-in-out infinite alternate; }
.jump__stage.is-charging .jump__crowd .mz-arm--r { animation: mz-clap-r .28s ease-in-out infinite alternate; }
.jump__stage.is-cheering .jump__crowd .mz-all { animation: mz-jump .6s cubic-bezier(.3,0,.3,1) infinite; }
.jump__stage.is-cheering .jump__crowd .mz-arm--l { transform: rotate(160deg); }
.jump__stage.is-cheering .jump__crowd .mz-arm--r { transform: rotate(-160deg); }
.jump__power {
	position: absolute; right: 16px; bottom: 64px; width: 20px; height: 230px; border-radius: 12px;
	background: rgba(60,25,10,.18); overflow: hidden;
}
.jump__power span {
	position: absolute; left: 0; right: 0; bottom: 0; height: var(--p, 0%);
	background: linear-gradient(0deg, #3F7A45, #EDB52B 50%, #C8141F);
	-webkit-mask: radial-gradient(circle, #000 4.6px, transparent 5.2px) 50% 100% / 20px 12px;
	        mask: radial-gradient(circle, #000 4.6px, transparent 5.2px) 50% 100% / 20px 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.welcome__grid, .night__grid, .jump__grid { grid-template-columns: 1fr; }
	.shield-grid { grid-template-columns: repeat(2, 1fr); }
	.night__text { padding-bottom: 0; }
	.collar { max-width: 520px; }
}
@media (max-width: 640px) {
	.shield-grid { gap: 2rem 1rem; }
	.shield-card__title { font-size: 1.05rem; }
	.collar__title { font-size: 1rem; }
	.collar__since { font-size: .78rem; }
	.jump__stage { height: 440px; }
	.jump__crowd--l { left: 6%; }
	.jump__crowd--r { right: 12%; }
	.hero__volcano { height: 44%; }
	.hero__hills { height: 30%; }
	.hero__ground { height: 24%; }
	.hero__parade { bottom: 2.6%; height: 38px; }
	.shuka-wave { height: 44px; margin: -22px 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hero__sun, .hero__clouds span, .hv-glow, .hv-smoke circle, .parade__track, .pw-leg, .shuka-wave__cloth,
	.shield-grid > li, .night__stars span, .flame, .fire-glow, .teller-arm, .sitter--back, .collar__beads { animation: none !important; }
	.hv-smoke circle { opacity: 0; }
}
