/* Home. One scroll through the whole game: key art, a doll to paint, the grey forest, then every part as its own colour field. */

/* ---------- hero ---------- */
.hm-hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; background: var(--sky); isolation: isolate; }
.hm-hero__art { position: absolute; inset: 0 0 auto; height: calc(52svh + 6rem); overflow: hidden; z-index: -1; }
.hm-hero__art picture, .hm-hero__art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-hero__art img { object-fit: cover; object-position: 50% 68%; }
/* The world starts grey; colour splats back in from the doll with the flag. CSS only, so it also runs without script. */
.hm-hero__grey { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.hm-hero__grey { display: block; filter: grayscale(1) brightness(1.08) contrast(0.86);
		-webkit-mask: url("../img/ui/splat-b.svg") 50% 46% / 0 0 no-repeat, linear-gradient(#000, #000); mask: url("../img/ui/splat-b.svg") 50% 46% / 0 0 no-repeat, linear-gradient(#000, #000);
		-webkit-mask-composite: xor; mask-composite: exclude;
		animation: hm-colour 1900ms cubic-bezier(0.6, 0, 0.2, 1) 450ms both; }
	.hm-hero__colour img { animation: hm-settle 2600ms var(--ease) both; }
}
@keyframes hm-colour { 0% { -webkit-mask-size: 0 0, auto; mask-size: 0 0, auto; } 99% { opacity: 1; } 100% { -webkit-mask-size: 340vmax 340vmax, auto; mask-size: 340vmax 340vmax, auto; opacity: 0; visibility: hidden; } }
@keyframes hm-settle { from { transform: scale(1.06); } to { transform: none; } }

.hm-hero__plate { position: relative; grid-row: 2; --field: var(--paper); background: var(--paper); padding: 0.5rem var(--gutter) 2rem; margin-top: 52svh; }
.hm-hero__say { max-width: 40rem; }
.hm-hero__say h1 { font-size: clamp(2.6rem, 11vw, 4rem); }
.hm-hero__say .lr-lead { margin-top: var(--s4); }
.hm-hero__say .lr-actions { margin-top: var(--s5); }
.hm-hero__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: var(--s6); font-size: var(--t-small); font-weight: 800; }
.hm-hero__facts li { display: inline-flex; align-items: center; gap: 0.4em; }
.hm-hero__facts .lr-icon { width: 1.25em; height: 1.25em; color: var(--pink-deep); }

.hm-hero__parts { display: none; }
.hm-hero__credit { position: absolute; right: var(--gutter); top: calc(var(--header-h) + 1rem); z-index: 1; }
.hm-paint__real { margin-top: var(--s6); max-width: 30rem; rotate: 1.2deg; }
.hm-hero__say h1 br { display: none; }
/* Plain links to the three parts: never styled like the game's own buttons. */
.hm-hero__parts a { display: inline-flex; align-items: center; gap: 0.45em; min-height: 2.75rem; padding: 0 0.9rem; font-weight: 800; font-size: var(--t-small); text-decoration: underline; text-decoration-thickness: 0.1em; text-underline-offset: 0.25em; border-radius: 999px; }
.hm-hero__parts a:hover { background: var(--lilac); }
.hm-hero__parts .lr-icon { width: 1.2em; height: 1.2em; }

@media (min-width: 56rem) {
	.hm-hero { grid-template-rows: 1fr; align-items: end; padding: calc(var(--header-h) + 2rem) var(--gutter) calc(clamp(40px, 6vw, 84px) + 1.75rem); }
	.hm-hero__art { inset: 0; height: auto; }
	.hm-hero__art img { object-position: 50% 42%; }
	.hm-hero__plate { grid-row: 1; margin: 0; padding: clamp(1.75rem, 2.6vw, 2.75rem); width: min(44rem, 54vw); border-radius: var(--r-xl); rotate: -1.2deg; box-shadow: 0 10px 0 #E4D6C0, var(--shadow-lift); }
	.hm-hero__plate .lr-edge { display: none; }
	.hm-hero__say h1 br { display: inline; }
	.hm-hero__say h1 { font-size: clamp(2.4rem, 3.75vw, 3.9rem); }
	.hm-hero__parts { position: absolute; right: var(--gutter); bottom: calc(clamp(40px, 6vw, 84px) + 1.75rem); display: flex; gap: 0.25rem; padding: 0.3rem 0.5rem; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-soft); }
	@media (prefers-reduced-motion: no-preference) {
		.hm-hero__plate { animation: hm-plate 1100ms var(--spring) 900ms both; }
		.hm-hero__parts { animation: hm-plate 900ms var(--spring) 1500ms both; }
	}
}
@keyframes hm-plate { from { opacity: 0; translate: 0 60px; scale: 0.94; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ---------- paint ---------- */
.hm-paint { padding-top: clamp(4rem, 8vw, 7rem); }
.hm-paint__grid { display: grid; gap: var(--s7); align-items: center; }
.hm-paint__say h2 { max-width: 9em; }
.hm-paint__say .lr-lead { margin-top: var(--s5); }
.hm-paint__try { display: none; align-items: center; gap: 0.6em; margin-top: var(--s5); font-weight: 900; font-size: var(--t-lead); }
.js .hm-paint__try { display: flex; }
.hm-paint__try .lr-icon { width: 1.6em; height: 1.6em; }
.hm-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block: var(--s5); }
.hm-tools li { display: inline-flex; align-items: center; gap: 0.45em; padding: 0.45em 0.95em 0.45em 0.7em; border-radius: 999px; background: rgb(255 255 255 / 0.5); font-size: var(--t-small); font-weight: 800; }
.hm-tools .lr-icon { width: 1.2em; height: 1.2em; }
@media (min-width: 56rem) { .hm-paint__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); } }

.pt { display: grid; gap: var(--s4); justify-items: center; }
.pt__stage { position: relative; width: min(100%, 26rem); aspect-ratio: 4 / 5; border-radius: var(--r-xl); background: var(--paper); box-shadow: 0 10px 0 var(--pink-deep), var(--shadow-lift); display: grid; place-items: center; overflow: hidden; rotate: -2deg; }
.pt__stage::before { content: ""; position: absolute; left: 50%; bottom: 6%; width: 46%; height: 5%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgb(43 20 70 / 0.22), transparent); }
.pt__fallback { display: flex; align-items: flex-end; justify-content: center; gap: 6%; width: 100%; height: 88%; }
.pt__fallback img { width: auto; height: auto; max-width: 40%; max-height: 100%; }
.js .pt[data-ready] .pt__fallback { display: none; }
.pt__canvas { position: relative; height: 90%; width: auto; touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pt__hint { position: absolute; top: 1rem; left: 50%; translate: -50% 0; display: inline-flex; align-items: center; gap: 0.4em; padding: 0.4em 0.9em; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: var(--t-small); font-weight: 900; white-space: nowrap; pointer-events: none; transition: opacity var(--mid) var(--ease), translate var(--mid) var(--ease); }
.pt__hint .lr-icon { width: 1.2em; height: 1.2em; }
.pt[data-painted] .pt__hint { opacity: 0; translate: -50% -10px; }
.pt__tools { display: grid; gap: var(--s4); justify-items: center; }
.pt__pans { display: flex; gap: 0.5rem; padding: 0.55rem 0.7rem; border-radius: 999px; background: var(--white); box-shadow: 0 5px 0 #E6C3D6, var(--shadow-soft); }
.pt-pan { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.55), transparent 42%), var(--c); box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.16); transition: transform var(--fast) var(--spring); }
.pt-pan:hover { transform: scale(1.08); }
.pt-pan[aria-pressed="true"] { transform: scale(1.12); outline: 3px solid var(--ink); outline-offset: 2px; }
.pt__btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.25rem; }
.pt__reset { display: inline-flex; align-items: center; gap: 0.4em; min-height: 2.75rem; padding: 0 0.6rem; border: 0; background: none; font-weight: 900; text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }
.pt__reset .lr-icon { width: 1.2em; height: 1.2em; }
@media (max-width: 26rem) { .pt__pans { gap: 0.15rem; padding: 0.4rem; } }

/* ---------- play: the forest goes from grey to colour as you scroll ---------- */
.hm-play { position: relative; background: #6c7078; }
.hm-play__pin { position: relative; height: 100svh; min-height: 34rem; overflow: hidden; display: grid; align-items: end; }
.hm-play picture, .hm-play picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-play picture img { object-fit: cover; object-position: 50% 60%; }
.hm-play__say { position: relative; z-index: 2; margin: 0 var(--gutter) clamp(1.25rem, 4vh, 3rem); padding: clamp(1.25rem, 2.4vw, 2.25rem); max-width: 36rem; border-radius: var(--r-lg); background: var(--paper); box-shadow: 0 8px 0 #E4D6C0, var(--shadow-lift); }
.hm-play__say h2 { font-size: clamp(1.75rem, 2.6vw + 1rem, 3rem); }
.hm-play__say p { margin-top: var(--s4); }
/* Without script or with less motion: a still before and after, split down the middle. */
.hm-play__colour { clip-path: inset(0 0 0 50%); }
.hm-play__pin::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 3px); width: 6px; background: var(--paper); }
.hm-play__ba { position: absolute; top: calc(var(--header-h) + 1.25rem); z-index: 1; }
.hm-play__ba--before { right: calc(50% + 1rem); } .hm-play__ba--after { left: calc(50% + 1rem); }
.hm-play__scroll { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.js .hm-play { height: 260svh; }
	.js .hm-play__pin { position: sticky; top: 0; }
	.js .hm-play__pin::after, .js .hm-play__ba { display: none; }
	.js .hm-play__scroll { display: inline; }
	.js .hm-play__colour { --p: 0; clip-path: none; -webkit-mask: url("../img/ui/splat-a.svg") 50% 62% / calc(var(--p) * 330vmax) calc(var(--p) * 330vmax) no-repeat; mask: url("../img/ui/splat-a.svg") 50% 62% / calc(var(--p) * 330vmax) calc(var(--p) * 330vmax) no-repeat; }
}

/* ---------- games ---------- */
.hm-games { padding-bottom: clamp(4rem, 8vw, 7rem); }
.hm-games__head .lr-lead { margin-top: var(--s5); color: var(--on-dark-soft); }
.hm-rail { display: flex; gap: clamp(1rem, 2vw, 1.75rem); margin-top: var(--s7); padding: 0.5rem max(var(--gutter), calc((100vw - var(--wide)) / 2)) 2rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wide)) / 2)); scrollbar-width: thin; scrollbar-color: var(--pink) transparent; overscroll-behavior-x: contain; }
.hm-game { flex: none; width: min(78vw, 27rem); scroll-snap-align: start; }
.hm-game img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-lg); box-shadow: 0 8px 0 #12061F; transition: transform var(--slow) var(--ease), rotate var(--slow) var(--ease); }
.hm-game:nth-child(odd) img { rotate: -1.2deg; } .hm-game:nth-child(even) img { rotate: 1deg; }
.hm-game:hover img { rotate: 0deg; transform: translateY(-6px) scale(1.02); }
.hm-game h3 { margin-top: var(--s5); }
.hm-game p { margin-top: var(--s2); color: var(--on-dark-soft); max-width: 24em; }
.hm-games__note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; font-size: var(--t-small); color: var(--on-dark-soft); }
.hm-games__note .lr-more { color: var(--paper); }
.hm-drive { display: grid; gap: var(--s6); align-items: center; margin-top: var(--s8); }
.hm-drive h3 { font-size: var(--t-headline); }
.hm-drive p { margin-top: var(--s4); color: var(--on-dark-soft); font-size: var(--t-lead); max-width: 28em; }
@media (min-width: 56rem) { .hm-drive { grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 5rem); } }
.lr-clip { aspect-ratio: 16 / 9; }
.lr-clip__btn { position: absolute; right: 0.75rem; top: 0.75rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--paper); color: var(--ink); cursor: pointer; }
.lr-clip__btn[aria-pressed="false"] { background: var(--sun); }

/* ---------- create ---------- */
.hm-create__grid { display: grid; gap: var(--s7); align-items: center; }
.hm-create__say .lr-lead { margin-top: var(--s5); }
.hm-maps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--s5); }
.hm-maps li { padding: 0.35em 0.95em; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: var(--t-small); font-weight: 800; }
.hm-maps li:nth-child(3n + 1) { rotate: -1.5deg; } .hm-maps li:nth-child(3n) { rotate: 1.5deg; }
.hm-create__soon { margin-top: var(--s5); font-weight: 700; }
.hm-create__shot { rotate: 1.5deg; aspect-ratio: 18 / 11; }
@media (min-width: 60rem) { .hm-create__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); } }

/* ---------- friends ---------- */
.hm-friends__grid { display: grid; gap: var(--s7); align-items: center; }
.hm-friends__grid .lr-lead { margin-top: var(--s5); }
.hm-friends__shot { rotate: -1.5deg; }
.hm-emojis { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block: var(--s5); }
.hm-emojis li { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--white); box-shadow: 0 5px 0 var(--sky-deep); }
.hm-emojis .lr-icon { width: 2.1rem; height: 2.1rem; }
@media (prefers-reduced-motion: no-preference) { .hm-emojis li:hover { animation: hm-bop 600ms var(--spring); } }
@keyframes hm-bop { 40% { transform: translateY(-10px) rotate(-8deg) scale(1.1); } }
@media (min-width: 60rem) { .hm-friends__grid:has(figure) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); } }
.hm-friends__grid > div { max-width: 44rem; }

/* ---------- dolls ---------- */
.hm-dolls__head .lr-lead { margin-top: var(--s5); }
.lu { display: flex; align-items: end; gap: clamp(0.75rem, 2vw, 2rem); margin-block: var(--s7) var(--s6); padding: 1rem max(var(--gutter), calc((100vw - var(--wide)) / 2)) 1.25rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--pink) transparent; }
.lu li { flex: none; scroll-snap-align: center; }
.lu-doll { display: grid; justify-items: center; gap: 0.75rem; text-decoration: none; border-radius: var(--r-md); }
.lu-doll__pic { position: relative; display: block; height: clamp(13rem, 30vw, 19rem); }
.lu-doll__pic::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -3%; height: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgb(43 20 70 / 0.2), transparent); }
.lu-doll__pic img { height: 100%; width: auto; max-width: none; transition: clip-path 700ms var(--ease), transform var(--slow) var(--spring); }
.lu-doll__painted { position: absolute; left: 50%; bottom: 0; translate: -50% 0; clip-path: inset(100% 0 0 0); }
.lu-doll:hover .lu-doll__painted, .lu-doll:focus-visible .lu-doll__painted, .lu-doll.is-painted .lu-doll__painted { clip-path: inset(0); }
.lu-doll:hover .lu-doll__plain, .lu-doll:focus-visible .lu-doll__plain, .lu-doll.is-painted .lu-doll__plain { opacity: 0; transition: opacity 200ms 500ms; }
.lu-doll:hover img { transform: translateY(-6px); }
html:not(.js) .lu-doll__painted { clip-path: none; }
html:not(.js) .lu-doll__plain { opacity: 0; }
.lu-doll__name { padding: 0.3em 0.95em; border-radius: 999px; background: var(--white); color: var(--ink); box-shadow: 0 4px 0 var(--felt); font-weight: 900; font-size: var(--t-small); white-space: nowrap; }

/* ---------- the real doll ---------- */
.hm-kit__grid { display: grid; gap: var(--s7); align-items: center; }
.hm-kit__grid .lr-lead { margin-block: var(--s5); }
.hm-kit__pics { position: relative; aspect-ratio: 1 / 0.86; max-width: 34rem; width: 100%; margin-inline: auto; }
.hm-kit__pics img { position: absolute; object-fit: cover; border-radius: var(--r-md); border: 8px solid var(--white); box-shadow: var(--shadow-lift); }
.hm-kit__a { left: 0; top: 0; width: 74%; aspect-ratio: 4 / 3; rotate: -3deg; }
.hm-kit__b { right: 0; bottom: 0; width: 44%; aspect-ratio: 3 / 4; rotate: 4deg; }
.hm-kit__c { left: 8%; bottom: 2%; width: 34%; aspect-ratio: 3 / 4; rotate: -6deg; }
@media (min-width: 60rem) { .hm-kit__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); } }

/* ---------- parents ---------- */
.hm-safe__grid { display: grid; gap: var(--s7); }
.hm-safe__grid .lr-lead { margin-block: var(--s5) var(--s6); }
.hm-rules { display: grid; gap: 0; border-top: 3px solid var(--ink); }
.hm-rules li { padding: 1.1rem 0; border-bottom: 3px solid var(--ink); font-size: var(--t-lead); line-height: 1.4; }
.hm-rules strong { font-family: var(--display); font-weight: 600; display: block; font-size: 1.15em; letter-spacing: -0.01em; }
@media (min-width: 60rem) { .hm-safe__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; } .hm-safe__grid > div { position: sticky; top: calc(var(--header-h) + 2rem); } }

/* ---------- where ---------- */
.hm-where__grid { display: grid; gap: var(--s7); align-items: center; }
.hm-where__grid .lr-lead { margin-block: var(--s5) var(--s6); }
.hm-plat { margin: 0; display: grid; }
.hm-plat > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; padding: 0.9rem 0; border-bottom: 2px solid var(--ink-line); }
.hm-plat dt { font-family: var(--display); font-weight: 600; font-size: var(--t-lead); }
.hm-plat dd { margin: 0; font-weight: 800; color: var(--ink-soft); }
@media (min-width: 60rem) { .hm-where__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); } }

/* ---------- news ---------- */
.hm-news { padding-top: clamp(2rem, 5vw, 4rem); }
.hm-news__list { display: grid; margin-block: var(--s6); border-top: 2px solid var(--ink-line); }
.hm-news__list li { display: grid; gap: 0.2rem 2rem; padding: 1.25rem 0; border-bottom: 2px solid var(--ink-line); }
.hm-news__list time { font-size: var(--t-small); font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hm-news__list a { font-family: var(--display); font-size: var(--t-title); font-weight: 600; line-height: 1.15; text-decoration: none; }
.hm-news__list a:hover { text-decoration: underline; text-decoration-thickness: 0.1em; }
.hm-news__list p { color: var(--ink-soft); max-width: 44em; }
@media (min-width: 56rem) { .hm-news__list li { grid-template-columns: 7rem 1fr; } .hm-news__list p { grid-column: 2; } }
