/* web/home: the home page. Tokens only (kit.css, covers.css). */

body { background: var(--page); color: var(--ink); margin: 0; }
main { display: block; }
.nb { white-space: nowrap; }
.big { margin: 0; font-size: clamp(34px, 4.3vw, 66px); line-height: 1.04; letter-spacing: -0.026em; text-wrap: balance; }
.mid { margin: 0; font-size: clamp(30px, 2.9vw, 44px); line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; }
/* until it's out, "Coming to CurseForge" stands where the links go (tools/web/build.mjs, links) */
.coming { display: none; }
[data-out="no"] .coming { display: block; }
[data-out="no"] .get { display: none; }
.lede { margin: 18px 0 0; text-wrap: pretty; }
.mid + .lede { margin-top: 12px; }
.all, .pair, .pals, .film { padding-top: clamp(96px, 17vh, 184px); }

/* ---------------- the world: real footage, washed so the words on it read ---------------- */
.world { position: absolute; inset: 0; overflow: hidden; background: var(--page); z-index: -1; }
.world-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.world::after { content: ''; position: absolute; inset: 0; pointer-events: none; }

/* ---------------- a live addon, in the page ---------------- */
.addon { position: relative; }
.addon:focus { outline: none; }
.addon .pdx-live { transition: opacity var(--t-ui) var(--ease); }
.addon.opening .pdx-live { opacity: 0; transition-duration: var(--t-fast); }
.addon .pdx-live:focus-visible { outline: none; }
.addon .pdx-live-wait, .addon .pdx-live-open { visibility: hidden; }

/* a round button: pause, and play once it's paused */
.round {
	-webkit-appearance: none; appearance: none; position: relative; cursor: pointer; flex: none;
	width: 44px; height: 44px; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
	background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--hair);
	transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.round[hidden] { display: none; }
.round svg { width: 20px; height: 20px; fill: currentColor; }
.round .tri, .round.paused .bars { display: none; }
.round.paused .tri { display: inline; }
.round:active { transform: scale(0.96); }
.round:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .round:hover { background: color-mix(in oklab, var(--ink) 10%, var(--raised)); } }

/* the page's own pointer */
.hand { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity var(--t-ui) var(--ease); z-index: 4; }
.hand.on { opacity: 1; }
.hand.gone { transition-duration: var(--t-fast); }
.hand svg {
	position: absolute; left: -2px; top: -2px; width: 22px; height: 31px; max-width: none; overflow: visible;
	fill: var(--ink); stroke: var(--page); stroke-width: 1.4; stroke-linejoin: round;
	transform-origin: 2px 2px; transition: transform var(--t-fast) var(--ease);
	filter: drop-shadow(0 1px 1px color-mix(in oklab, var(--shadow) 50%, transparent)) drop-shadow(0 4px 8px color-mix(in oklab, var(--shadow) 35%, transparent));
}
.hand.down svg { transform: scale(0.86); }
.tap { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); opacity: 0; }

/* ---------------- the first screen ---------------- */
.bar {
	position: absolute; left: 0; right: 0; top: 0; z-index: 6; box-sizing: border-box; height: 72px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.bar .lockup { color: inherit; text-decoration: none; min-height: 44px; }
.bar .coming { font-size: 15px; }
.hero {
	/* the window's own width: 1:1 on a laptop, bigger where there's the height for it */
	--win: min(92vw, 1440px, max(1064px, (100svh - 300px) * 1.612));
	position: relative; isolation: isolate; overflow-x: clip;
	display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center;
	padding: clamp(66px, 8.4vh, 96px) 0 clamp(48px, 8vh, 88px);
}
.hero .world-film { object-position: 14% 62%; }
.hero .world::after {
	background:
		linear-gradient(to bottom, transparent 62%, var(--page) 100%),
		linear-gradient(to bottom, color-mix(in oklab, var(--page) 74%, transparent) 0%, color-mix(in oklab, var(--page) 64%, transparent) 270px, color-mix(in oklab, var(--page) 10%, transparent) 540px, color-mix(in oklab, var(--page) 10%, transparent) 100%);
}
.head { text-align: center; padding: 0 var(--gutter); }
.lockup { margin: 0; font-size: clamp(28px, 2.2vw, 34px); }
.title { font-size: clamp(36px, 4.5vw, 72px); line-height: 1.02; letter-spacing: -0.026em; margin: 0; text-wrap: balance; }
.sub { margin: clamp(8px, 1.2vh, 14px) auto 0; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.45; color: var(--ink); text-wrap: balance; }

.stage { position: relative; }
/* the game's screen is wider than the window on it: it's the window that's lined up */
.stage { width: calc(var(--win) * 1280 / 1064); aspect-ratio: 1280 / 760; margin: calc(var(--win) * -50 / 1064) 0; }
.hero .stage { margin-top: calc(var(--win) * -50 / 1064 + 14px); }
/* the window's own shape, until it opens */
.stage::before {
	content: ''; position: absolute; z-index: 0;
	left: calc(100% * 108 / 1280); right: calc(100% * 108 / 1280); top: calc(100% * 50 / 760); bottom: calc(100% * 50 / 760);
	border-radius: calc(var(--win) * 18 / 1064); background: var(--page); box-shadow: 0 0 0 1px var(--hair), 0 30px 80px -20px var(--shadow);
}

/* what it's showing, along the window's own top edge */
.tour {
	position: relative; z-index: 2; box-sizing: border-box; width: var(--win); margin-top: clamp(18px, 3vh, 34px); scroll-margin-top: 16px;
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; align-items: center;
}
.props { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--raised); box-shadow: 0 0 0 1px var(--hair); }
.prop {
	-webkit-appearance: none; appearance: none; border: 0; background: none; cursor: pointer; white-space: nowrap;
	min-height: 36px; padding: 0 15px; border-radius: 999px; color: var(--ink2); font: 500 15px/1 var(--f-text);
	transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.prop .short { display: none; }
.prop[aria-pressed="true"] { color: var(--ink); background: color-mix(in oklab, var(--ink) 13%, transparent); }
.prop:active { transform: scale(0.96); }
.prop:focus-visible { outline: 2px solid var(--ink2); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .prop:hover { color: var(--ink); } }
.says { margin: 0; font-size: 16px; line-height: 1.4; text-align: right; text-wrap: balance; }
.tour .round.off { display: none; }

/* ---------------- all of them ---------------- */
.all .words, .pals .words { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: clamp(32px, 6vw, 96px); align-items: end; }
.all .lede, .pals .lede { margin: 0 0 0.35em; }
.wall { --cols: 17; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(6px, 0.9vw, 14px); margin-top: clamp(32px, 5vh, 56px); }
.one { -webkit-appearance: none; appearance: none; border: 0; padding: 0; background: none; cursor: pointer; aspect-ratio: 1; border-radius: 50%; position: relative; }
.one .portrait { display: block; width: 100%; height: 100%; }
.one .portrait::before { content: ''; position: absolute; inset: 0; background: color-mix(in oklab, var(--ink) 15%, var(--page)); transition: opacity var(--t-ui) var(--ease); }
.one .portrait::after { transition: opacity var(--t-ui) var(--ease); }
.one .no { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink2); }
/* its silhouette, its picture, and its model over them while it's the one (page.js, Wall) */
.one .dark, .one .still { position: absolute; inset: 0; background: url('/media/wall/wall.webp') no-repeat; background-size: var(--sheet); transition: opacity var(--t-ui) var(--ease); }
.one .dark { opacity: 0.82; }
.one.found .dark, .one .still, .one .portrait canvas { opacity: 0; }
.one .portrait canvas { transition: opacity var(--t-ui) var(--ease); }
.one.found .still, .one .moving canvas { opacity: 1; }
.one .moving .still { opacity: 0; }
.one .moving .still, .one .moving canvas { transition: none; }
.one:not(.found) .no { color: var(--ink2); }
.one:not(.found) .portrait::after { opacity: 0; }
.one.found .portrait::before { opacity: 0; }
.one::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.one[aria-current="true"]::after { opacity: 1; }
.one:focus { outline: none; }
.one:focus-visible::after { box-shadow: inset 0 0 0 3px var(--ink); }
/* what's said of the one you're on never changes its height: it's one line, and a longer one ends in … */
.wall-says { display: flex; align-items: baseline; gap: 4px 14px; margin: clamp(22px, 3vh, 32px) 0 0; font-size: 16px; line-height: 1.45; height: 2em; white-space: nowrap; }
.wall-says > * { flex: none; }
.wall-says .wall-how { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wall-says .mono { font-size: 14px; }
.wall-name { font: 400 22px/1.2 var(--f-display); letter-spacing: -0.012em; }
.wall-count { min-width: 8.2em; }
.wall-says .wall-count .mono:first-child { font-size: 22px; }

/* ---------------- in the wild ---------------- */
.wild { position: relative; isolation: isolate; overflow: clip; margin-top: clamp(96px, 17vh, 184px); }
.wild-in { position: relative; box-sizing: border-box; --h: min(860px, max(100svh, 780px) - 24px); min-height: max(100svh, 780px); width: 100%; max-width: var(--wide); margin-inline: auto; padding: clamp(56px, 10vh, 112px) var(--gutter); }
/* the frog a third of the way across, the addon's window clear of it */
.wild .world-film { left: -22%; width: 122%; max-width: none; object-position: 50% 78%; }
@media (max-width: 1320px) { .wild .world-film { left: -34%; width: 134%; } }
.wild .world::after {
	background:
		linear-gradient(100deg, color-mix(in oklab, var(--page) 80%, transparent) 0%, color-mix(in oklab, var(--page) 56%, transparent) 28%, transparent 56%),
		linear-gradient(to bottom, color-mix(in oklab, var(--page) 40%, transparent), transparent 44%);
}
.wild .words { position: relative; max-width: min(35rem, 44vw); z-index: 1; }
.wild .lede { color: var(--ink); }
/* the window's right edge on the page's own: it's 88 in from the screen's */
.wild-addon { position: absolute; right: calc(var(--gutter) - var(--h) * 88 / 760); top: 50%; height: var(--h); aspect-ratio: 640 / 760; transform: translateY(-50%); }
.frog { -webkit-appearance: none; appearance: none; position: absolute; left: 0; top: 0; width: 300px; height: 210px; border: 0; padding: 0; border-radius: 40%; background: none; cursor: help; }
.wild-in:not(.spotted) .frog { z-index: 2; } /* on a phone the addon's screen reaches over it, with nothing open there yet */
.frog:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* ---------------- the list and Near you ---------------- */
.pair-in { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 112px); }
/* no wider than its half, whatever's in it */
.half { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 2; }
.half .words { max-width: 30rem; }
/* the narrow window is 440 of its 464 across, with its shadow round it */
.tall { width: min(100%, 560px); aspect-ratio: 464 / 700; margin: clamp(20px, 3vh, 36px) 0 0 -14px; }
.tall::before { content: ''; position: absolute; inset: 2.9% 2.6%; border-radius: 18px; background: var(--page); box-shadow: 0 0 0 1px var(--hair); }

/* ---------------- friends ---------------- */
.pals { --win: min(100vw - 2 * var(--gutter), 1208px); overflow-x: clip; }
/* as far under its words as the wall is under its own */
.pals .stage { margin-top: calc(var(--win) * -50 / 1064 + clamp(32px, 5vh, 56px)); margin-inline: calc(var(--win) * -108 / 1064); }

/* ---------------- the film, small ---------------- */
.film { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: clamp(32px, 6vw, 96px); align-items: center; }
.film[hidden] { display: none; }
.film-box { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--sunken); box-shadow: 0 0 0 1px var(--hair); }
.film-box video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------------- the end ---------------- */
.end { text-align: center; padding: clamp(112px, 20vh, 220px) var(--gutter) clamp(80px, 14vh, 150px); }
.end-mark { font-size: clamp(54px, 6.4vw, 96px); margin: 0; justify-content: center; }
.gets { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(26px, 4vh, 40px); }
.end .coming { margin: clamp(14px, 2vh, 22px) 0 0; font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -0.012em; }
.works { margin: 18px 0 0; font-size: 15px; text-wrap: balance; }
/* the header again, upside down: one line, ruled off from the page above */
.foot { font-size: 14px; line-height: 1.5; padding-bottom: env(safe-area-inset-bottom); }
.foot-in { display: flex; align-items: center; justify-content: space-between; column-gap: 32px; min-height: 80px; border-top: 1px solid var(--hair); }
.made { flex: none; }
.made a { display: inline-block; padding: 12px 8px; margin-inline: -8px; border-radius: 12px; color: var(--ink); transition: text-decoration-color var(--t-fast) var(--ease); }
.made a:focus-visible { outline: 2px solid var(--ink2); outline-offset: -7px; }
@media (hover: hover) and (pointer: fine) { .made a:hover { text-decoration-color: currentColor; } }

/* past the first screen: pause, and where to get it */
.corner {
	position: fixed; z-index: 10; display: flex; gap: 8px; align-items: center;
	right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
}
.corner[hidden] { display: none; }
.corner .btn { min-height: 44px; background: var(--raised); box-shadow: 0 0 0 1px var(--hair), 0 8px 24px -8px var(--shadow); }
.corner .round { box-shadow: 0 0 0 1px var(--hair), 0 8px 24px -8px var(--shadow); }
@media (hover: hover) and (pointer: fine) { .corner .btn:hover { background: color-mix(in oklab, var(--ink) 10%, var(--raised)); } }

/* ---------------- smaller screens: the addon's own narrow window ---------------- */
@media (max-width: 1100px) {
	.wall { --cols: 13; }
	.wall-says { flex-wrap: wrap; height: 3.9em; align-content: start; }
	.wall-says .wall-how { flex-basis: 100%; }
	.foot-in { flex-direction: column; justify-content: center; text-align: center; padding-block: 20px 28px; }
	.fine { text-wrap: balance; }
}
@media (max-width: 999px) {
	.hero { --win: min(100vw - 24px, 500px); }
	.bar { height: 64px; }
	.hero { padding-top: 72px; }
	.tour { width: calc(var(--win) * 440 / 464); grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; column-gap: 12px; margin-top: 18px; }
	.props { grid-column: 1 / -1; justify-content: space-between; }
	.prop { flex: 1 1 auto; min-height: 44px; padding: 0 8px; }
	.says { text-align: left; padding-left: 6px; text-wrap: pretty; }
	.tour { grid-template-rows: auto minmax(45px, auto); } /* two lines of it, so the window stays put */
	.hero .stage, .pals .stage { width: var(--win); aspect-ratio: 464 / 700; margin: 8px auto 0; }
	.stage::before { left: 2.6%; right: 2.6%; top: 2.9%; bottom: 2.9%; border-radius: 18px; }
	.all .words, .pals .words { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
	.pals { --win: min(100vw - 24px, 500px); }
	.pals .stage { margin: clamp(20px, 3vh, 36px) auto 0; }
	.wild .words { max-width: 34rem; }
	.wild .world-film { left: 0; width: 100%; object-position: 50% 60%; }
	.wild-in { min-height: 0; padding-bottom: 24px; }
	.wild-addon { position: relative; right: auto; top: auto; transform: none; height: auto; left: 50%; width: calc(min(100vw - 24px, 500px) * 640 / 464); margin-left: calc(min(100vw - 24px, 500px) * -320 / 464); }
	.wild .world::after { background: linear-gradient(to bottom, color-mix(in oklab, var(--page) 82%, transparent), color-mix(in oklab, var(--page) 62%, transparent) 260px, transparent 480px); }
	.film { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
}
@media (max-width: 760px) {
	.wall { --cols: 7; gap: 6px; }
	.pair-in { grid-template-columns: minmax(0, 1fr); row-gap: clamp(72px, 12vh, 110px); }
	.half { grid-row: auto; grid-template-rows: auto; }
	.tall { margin-left: -9px; width: min(100% + 18px, 500px); }
	.prop { padding: 0 8px; font-size: 14px; }
	.prop .long { display: none; }
	.prop .short { display: inline; }
	.says { font-size: 15px; }
	/* the count, who it is, then up to three lines of how */
	.wall-says { height: 9.4em; }
	.wall-count { flex-basis: 100%; }
	.wall-says .wall-how { white-space: normal; text-wrap: pretty; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
	.corner .btn { display: none; } /* nobody installs an addon on a phone: there, it's Pause alone */
}
@media (prefers-reduced-motion: reduce) {
	.hand { display: none; }
	.one .portrait::before, .one .portrait::after, .one .dark, .one .still, .addon .pdx-live { transition: none; }
}
