/*
 * Lempar — the homepage (T-384, T-526).
 *
 * The hero is round 5's "A1 Bento" of the canvas "frisbee.id hero options"
 * (https://claude.ai/artifact/8gfqFA9ULUxWoAWp9APcZs), at 390 and 1280:
 * the headline, the lead, the button and six coloured tiles, the first
 * Tournaments' live Turnamen box (wpfb-tournaments/now, round 6). Below it,
 * option C's grid of drawn screens and the organisers' card (Aaron's
 * "frisbee.id Option C", the family repository's docs/research/
 * 2026-11-03-homepage-option-c/). The markup is patterns/home.php; this
 * file loads only on a page that places that pattern
 * (lempar_content_stylesheets()).
 *
 * Every colour is a preset, so dark mode follows the scheme. The drawing's
 * colours map as: #fff6ec base, #fff surface, #23222b contrast, #6e6978
 * muted, #f1e3d3 line, #ff6b4a accent, #ffd23f highlight, #3ec4a8 spirit,
 * #f7ebde surface-raised. Its three others are mixes: the coral tile
 * #ffe1d8 is 15% accent into base, the bracket's joins #e3d2bf 10% contrast
 * into line, and the inverse card's text #d9d4e0 20% contrast into base.
 * The bento's tiles are §2's own.
 *
 * Layout is decided by the page's own width (container `lempar-home`),
 * not the window's, since from 900px of window the sidebar takes a share:
 * under 720px of it, the phone's drawing.
 *
 * The site's header, footer and focus ring stay; the drawing's header and
 * its 3px ink focus outline are the mockup's.
 */

/* -------------------------------------------------------------------------
 * 1. The container, and which phrasing shows
 * ---------------------------------------------------------------------- */

.lempar-home {
	container: lempar-home / inline-size;
	font-family: var(--wp--preset--font-family--nunito);
	color: var(--wp--preset--color--contrast);
}

/* One width's phrasing is hidden at the other; scoped to the page, so it outranks a part's own display. */
@container lempar-home (min-width: 720px) {
	.lempar-home .lempar-home__narrow {
		display: none;
	}
}

@container lempar-home (max-width: 719.98px) {
	.lempar-home .lempar-home__wide {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * 2. The bento (T-526)
 * ---------------------------------------------------------------------- */

/*
 * "Satu warna", one colour (T-526 amended 2026-11-18, round 7): the coral
 * is on the Turnamen box alone, a darker one so white reads on it; every
 * other tile is a plain card, the surface with a line inside its edge and
 * the page's ink, its icon in coral; the button is ink. The drawing's
 * light values are lempar's presets, and its dark ones a shade off them,
 * so the presets stand. The two corals are no presets, as ruled: the
 * drawing's own, here only, so the editor never offers them, and lempar's
 * accent is not moved.
 */
.lempar-home {
	--lempar-home-tile-ink: var(--wp--preset--color--contrast);
	--lempar-home-icon: light-dark(#e8603c, #f08566);
	--lempar-home-box: #c4472a;
	--lempar-home-box-ink: #fff;
}

/* On the phone: headline and lead, the tiles, then the button. */
.lempar-home__bento {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "intro" "action" "tiles";
	gap: 28px;
	padding-block: 0 56px;
}

.lempar-home__intro {
	grid-area: intro;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.lempar-home__title {
	margin: 0;
	font-family: inherit;
	font-size: 54px;
	font-weight: 900;
	line-height: 1.04;
	letter-spacing: 0;
	color: var(--wp--preset--color--contrast);
	text-wrap: balance;
}

.lempar-home__intro-text {
	margin: 0;
	font-size: 19px;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}

/*
 * The rules area (T-607): a line under the lead, the book in the tiles'
 * coral and the words in the page's ink, underlined as a link in a
 * sentence is, a 44px target that keeps its place in the text.
 */
.lempar-home__rules {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.lempar-home__rules .lempar-home__icon {
	width: 24px;
	height: 24px;
}

.lempar-home__rules .lempar-home__icon:last-child {
	width: 20px;
	height: 20px;
	color: inherit;
	transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lempar-home__rules-words {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	text-decoration-color: var(--lempar-home-icon);
}

@media (hover: hover) {
	.lempar-home__rules:hover .lempar-home__icon:last-child {
		transform: translateX(3px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lempar-home__rules .lempar-home__icon:last-child {
		transition: none;
	}
}

/* Two classes, so the pill's own `display` and padding further down give way. */
.lempar-home__button.lempar-home__action {
	grid-area: action;
	justify-self: start;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 28px;
	font-size: 17px;
}

/*
 * The wide page's bento: four columns, the box two across and two tall,
 * Playbook and Statistik beside it, Akademi and Kelola Tim under them,
 * Profil pemain a row across the foot.
 */
.lempar-home__tiles {
	grid-area: tiles;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(2, 170px) 84px;
	gap: 14px;
}

.lempar-home__now {
	grid-column: 1 / span 2;
	grid-row: 1 / span 2;
	display: grid;
	min-width: 0;
	--wpfb-tournaments-now-ground: var(--lempar-home-box);
	--wpfb-tournaments-now-ink: var(--lempar-home-box-ink);
	--wpfb-tournaments-now-radius: 28px;
	/*
	 * Tournaments 2.136.0's four (T-526, ruled: 4.5:1 wins over the
	 * drawing). The quiet words are the ink, since any mix into this coral
	 * falls under 4.5; a cell is 15% black into the ground, darker and not
	 * lighter, #a73c24; the chip is the ink of the nearest preset in light
	 * and the ground in dark, as drawn, with white words. Unset, each is
	 * what the block drew before.
	 */
	--wpfb-tournaments-now-quiet: var(--lempar-home-box-ink);
	--wpfb-tournaments-now-cell: color-mix(in srgb, var(--lempar-home-box) 85%, #000);
	--wpfb-tournaments-now-chip: light-dark(var(--wp--preset--color--contrast), var(--wp--preset--color--base));
	--wpfb-tournaments-now-chip-ink: var(--lempar-home-box-ink);
}

.lempar-home__now > * {
	min-width: 0;
}

.lempar-home__tile {
	box-sizing: border-box;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 8px;
	padding: 18px;
	border-radius: 24px;
	background: var(--wp--preset--color--surface);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--line);
	color: var(--lempar-home-tile-ink);
	text-decoration: none;
	transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lempar-home__tile:hover,
.lempar-home__tile:visited {
	color: var(--lempar-home-tile-ink);
	text-decoration: none;
}

@media (hover: hover) {
	.lempar-home__tile:hover {
		transform: translateY(-2px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lempar-home__tile {
		transition: none;
	}

	.lempar-home__tile:hover {
		transform: none;
	}
}

.lempar-home__tile.is-turnamen,
.lempar-home__tile.is-turnamen:hover,
.lempar-home__tile.is-turnamen:visited {
	padding: 22px;
	border-radius: 28px;
	background: var(--lempar-home-box);
	box-shadow: none;
	color: var(--lempar-home-box-ink);
}

.lempar-home__tile.is-profil {
	grid-column: 1 / -1;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 16px;
	padding-block: 0;
	padding-inline: 22px;
}

.lempar-home__icon {
	flex: none;
	display: block;
	width: 28px;
	height: 28px;
	color: var(--lempar-home-icon);
}

.lempar-home__tile.is-turnamen .lempar-home__icon {
	width: 40px;
	height: 40px;
	color: inherit;
}

.lempar-home__tile-top,
.lempar-home__tile-foot {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
}

.lempar-home__tile-foot .lempar-home__icon {
	width: 30px;
	height: 30px;
}

.lempar-home__tile.is-profil .lempar-home__tile-foot {
	flex: 1;
	align-items: center;
}

.lempar-home__tile.is-profil .lempar-home__tile-foot .lempar-home__icon {
	width: 26px;
	height: 26px;
}

.lempar-home__tile-words {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.lempar-home__tile-name {
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
}

.lempar-home__tile.is-turnamen .lempar-home__tile-name {
	font-size: 30px;
	line-height: 1.2;
}

.lempar-home__tile-sub {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: color-mix(in srgb, currentColor 80%, var(--wp--preset--color--surface));
}

.lempar-home__tile.is-turnamen .lempar-home__tile-sub {
	color: inherit;
}

/*
 * From 900px of the page, headline left and bento right, the left column
 * centred against the bento as drawn (460 of 1168 there, 56 apart).
 */
@container lempar-home (min-width: 900px) {
	.lempar-home__bento {
		grid-template-columns: minmax(0, 460fr) minmax(0, 652fr);
		grid-template-rows: 1fr auto auto 1fr;
		grid-template-areas: ". tiles" "intro tiles" "action tiles" ". tiles";
		gap: 18px 56px;
		padding-block: 0 64px;
	}
}

/* The page's buttons are the drawings' pills, not wp-element-button. */
.lempar-home__button {
	display: inline-block;
	padding: 14px 24px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.375;
	text-decoration: none;
	background: var(--wp--preset--color--accent);
	transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.18s ease-out;
}

/* The hero's is ink with the page's ground for its words, in both schemes (round 7). */
.lempar-home__button--hero,
.lempar-home__button--hero:hover,
.lempar-home__button--hero:visited {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* The playground's is the site's white on the coral, as drawn. */
.lempar-home__button--primary,
.lempar-home__button--primary:hover,
.lempar-home__button--primary:visited {
	color: var(--wp--preset--color--accent-contrast);
}

.lempar-home__button--hero:hover {
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.lempar-home__button {
		transition: none;
	}

	.lempar-home__button--hero:hover {
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * 3. Option C's cards and their screens (T-384)
 * ---------------------------------------------------------------------- */

.lempar-home__turnamen {
	padding-block: 0 56px;
}

.lempar-home__cards {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.lempar-home__row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.lempar-home__card {
	box-sizing: border-box;
	flex: 1 1 300px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 28px;
}

.lempar-home__card--bracket {
	flex: 2 1 640px;
}

.lempar-home__head {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 26px 28px 18px;
}

.lempar-home__card--bracket .lempar-home__head {
	padding-bottom: 8px;
}

.lempar-home__card-title {
	margin: 0;
	font-family: inherit;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--wp--preset--color--contrast);
}

.lempar-home__card-text {
	margin: 0;
	font-size: 16px;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}

/* The wide bracket sits on the card, with no phone round it. */
.lempar-home__flat {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 20px 20px;
}

/* A coloured panel with a phone rising out of its foot. */
.lempar-home__panel {
	box-sizing: border-box;
	display: block;
	height: 300px;
	margin-top: auto;
	padding: 26px 40px 0;
	overflow: hidden;
}

.lempar-home__card--tall .lempar-home__panel {
	height: 330px;
}

/*
 * In dark a yellow or teal panel is 15% of its colour into the base, as the
 * coral tile is in both schemes: a dark ground with the colour's cast, not
 * a bright one (T-398). The phone's frame keeps 2.1:1 or more against it.
 */
.lempar-home__panel.is-highlight {
	background: light-dark(var(--wp--preset--color--highlight), color-mix(in srgb, var(--wp--preset--color--highlight) 15%, var(--wp--preset--color--base)));
}

.lempar-home__panel.is-spirit {
	background: light-dark(var(--wp--preset--color--spirit), color-mix(in srgb, var(--wp--preset--color--spirit) 15%, var(--wp--preset--color--base)));
}

.lempar-home__panel.is-raised {
	background: var(--wp--preset--color--surface-raised);
}

.lempar-home__panel.is-coral {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 15%, var(--wp--preset--color--base));
}

/*
 * The phone's frame is ink in light. In dark the ink is light, so the frame
 * is 35% of it into the base: apart from the screen inside and from
 * the raised panel round it, where the base alone was lost.
 */
.lempar-home__phone {
	/* Named so a feature page's whole phone (feature.css) can close its frame in the same colour. */
	--lempar-home-frame: light-dark(var(--wp--preset--color--contrast), color-mix(in srgb, var(--wp--preset--color--contrast) 35%, var(--wp--preset--color--base)));
	display: block;
	overflow: hidden;
	background: var(--wp--preset--color--base);
	border: 8px solid var(--lempar-home-frame);
	border-bottom: 0;
	border-radius: 30px 30px 0 0;
}

.lempar-home__svg {
	display: block;
	width: 100%;
	height: auto;
	font-family: var(--wp--preset--font-family--nunito);
	fill: var(--wp--preset--color--contrast);
}

/*
 * The organisers' card, inverted in light: ink, with light words. In dark it
 * is not turned light (T-398): the raised surface, a step above the page and
 * the other cards, with the page's ink.
 */
.lempar-home__card--inverse {
	gap: 14px;
	padding: 30px 28px;
	background: light-dark(var(--wp--preset--color--contrast), var(--wp--preset--color--surface-raised));
	border: 0;
	color: light-dark(var(--wp--preset--color--surface), var(--wp--preset--color--contrast));
}

.lempar-home__badge {
	align-self: flex-start;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--highlight);
	color: var(--wp--preset--color--highlight-contrast);
	font-size: 13px;
	font-weight: 800;
	line-height: 1.4;
}

.lempar-home__inverse-title {
	margin: 0;
	font-family: inherit;
	font-size: 28px;
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: 0;
	color: inherit;
	text-wrap: balance;
}

.lempar-home__inverse-text {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	/* In dark, 80% of the ink into the raised surface: 8.35:1, over the 7:1 dark mode's small text keeps. */
	color: light-dark(color-mix(in srgb, var(--wp--preset--color--contrast) 20%, var(--wp--preset--color--base)), color-mix(in srgb, var(--wp--preset--color--contrast) 80%, var(--wp--preset--color--surface-raised)));
}

.lempar-home__card--inverse .lempar-home__button {
	align-self: flex-start;
	margin-top: auto;
}

/* -------------------------------------------------------------------------
 * 4. The phone's drawing (mobile.html), under 720px of the page
 * ---------------------------------------------------------------------- */

@container lempar-home (max-width: 719.98px) {
	/* Headline and lead, the tiles, then the button across the column. */
	.lempar-home__bento {
		grid-template-areas: "intro" "tiles" "action";
		gap: 18px;
		padding-block: 0 36px;
	}

	.lempar-home__intro {
		gap: 10px;
	}

	.lempar-home__intro-text {
		font-size: 17px;
	}

	.lempar-home__button.lempar-home__action {
		justify-self: stretch;
	}

	/*
	 * The box across, Playbook and Statistik two across, then the last three
	 * small, a row of three: six columns.
	 */
	.lempar-home__tiles {
		grid-template-columns: repeat(6, minmax(0, 1fr));
		grid-template-rows: none;
		gap: 10px;
	}

	.lempar-home__now {
		grid-column: 1 / -1;
		grid-row: auto;
		--wpfb-tournaments-now-radius: 22px;
	}

	.lempar-home__tile {
		padding: 14px;
		border-radius: 22px;
	}

	.lempar-home__tile.is-turnamen {
		min-height: 150px;
		padding: 14px;
		border-radius: 22px;
	}

	.lempar-home__tile.is-medium {
		grid-column: span 3;
		min-height: 112px;
	}

	.lempar-home__tile.is-small,
	.lempar-home__tile.is-profil {
		grid-column: span 2;
		min-height: 92px;
		flex-direction: column;
		align-items: stretch;
		justify-content: space-between;
		gap: 8px;
		padding: 12px;
	}

	.lempar-home__icon {
		width: 26px;
		height: 26px;
	}

	.lempar-home__tile.is-turnamen .lempar-home__icon {
		width: 30px;
		height: 30px;
	}

	.lempar-home__tile-foot .lempar-home__icon {
		width: 26px;
		height: 26px;
	}

	.lempar-home__tile.is-small .lempar-home__icon {
		width: 22px;
		height: 22px;
	}

	.lempar-home__tile.is-profil .lempar-home__tile-foot {
		flex: none;
	}

	/* The small tiles are a name alone, and Profil pemain loses its arrow. */
	.lempar-home__tile.is-small:not(.is-soon) .lempar-home__tile-sub,
	.lempar-home__tile.is-profil .lempar-home__tile-foot .lempar-home__icon {
		display: none;
	}

	/* Except a section that is not open, which says so (T-548). */
	.lempar-home__tile.is-soon .lempar-home__tile-sub {
		font-size: 12px;
		line-height: 1.2;
	}

	.lempar-home__tile-name {
		font-size: 17px;
	}

	.lempar-home__tile.is-small .lempar-home__tile-name {
		font-size: 15px;
		line-height: 1.15;
	}

	.lempar-home__tile.is-turnamen .lempar-home__tile-name {
		font-size: 24px;
	}

	.lempar-home__turnamen {
		padding-block: 0 36px;
	}

	/* Bracket, then statistics and standings two across, then the organisers. */
	.lempar-home__cards {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px 12px;
	}

	.lempar-home__row {
		display: contents;
	}

	.lempar-home__card--bracket,
	.lempar-home__card--inverse {
		grid-column: 1 / -1;
	}

	.lempar-home__card {
		border-radius: 22px;
	}

	.lempar-home__head {
		gap: 4px;
		padding: 16px 14px 10px;
	}

	.lempar-home__card-title {
		font-size: 16px;
	}

	.lempar-home__card--bracket {
		border-radius: 26px;
	}

	.lempar-home__card--bracket .lempar-home__head {
		padding: 20px 20px 14px;
	}

	.lempar-home__card--bracket .lempar-home__card-title {
		font-size: 19px;
	}

	.lempar-home__card-text {
		font-size: 15px;
	}

	.lempar-home__panel,
	.lempar-home__card--tall .lempar-home__panel {
		height: 190px;
		padding: 14px 14px 0;
	}

	.lempar-home__phone {
		border-width: 5px;
		border-radius: 18px 18px 0 0;
	}

	.lempar-home__card--bracket .lempar-home__panel {
		height: 270px;
		padding: 20px 44px 0;
	}

	.lempar-home__card--bracket .lempar-home__phone {
		border-width: 7px;
		border-radius: 26px 26px 0 0;
	}

	.lempar-home__card--inverse {
		gap: 12px;
		padding: 24px 20px;
		border-radius: 26px;
	}

	.lempar-home__inverse-title {
		font-size: 24px;
	}

	.lempar-home__inverse-text {
		font-size: 15px;
	}

	.lempar-home__card--inverse .lempar-home__button {
		margin-top: 0;
		padding: 13px 22px;
		font-size: 15px;
	}
}
