/*
 * The join and entry screens of the artist pages (design §4 direction A, §5.1).
 *
 * The blocks sit on the counter field (`.ti-counter-field`), the near-black stage of the night in
 * both palettes of the theme, and read only the field contract: --ti-strong, --ti-quiet,
 * --ti-muted, --ti-line, --ti-well, --ti-flare, --ti-field, --ti-accent. No colour literal here.
 *
 * Measured on #080808 (the counter field of both palettes):
 *   strong 19.8:1, quiet 78% about 12.5:1, muted 66% about 8.5:1, all text;
 *   flare #F65D00 6.18:1 as text and as the edge of the seal; the field on flare 6.18:1 (buttons);
 *   control edge = strong 42% over the field, about #707070: 4.05:1 on the field, 3.45:1 on the well;
 *   error = accent and strong half and half, about #E2968F: 8.6:1.
 *
 * Nothing here starts hidden or moves; the only transitions are colour, and they stop with
 * prefers-reduced-motion.
 */

.ti-community-join,
.ti-community-entry {
	--ti-community-edge: color-mix( in srgb, var( --ti-strong ) 42%, var( --ti-field ) );
	--ti-community-error: color-mix( in srgb, var( --ti-accent ) 50%, var( --ti-strong ) );
	--ti-community-gutter: var( --wp--style--root--padding-left, 1.5rem );

	color: var( --ti-strong );
}

/* The site's one container: the header row's width and left edge (measured: 32 px at 1440, 20 at 390). */
/*
 * The theme's shell grows `main` to the viewport; a short entry page would leave that spare height
 * in the page's own (light) field between the dark block and the footer, measured as a band of up
 * to 70 px at 1440x900. The block takes the spare height instead.
 */
main:has( > .ti-community-join, > .ti-community-entry ) {
	display: flex;
	flex-direction: column;
}

main > .ti-community-join,
main > .ti-community-entry {
	flex: 1 0 auto;
}

.ti-community-wrap {
	box-sizing: border-box;
	width: min( 100% - 2 * var( --ti-community-gutter ), var( --wp--style--global--wide-size, 86rem ) );
	margin-inline: auto;
}

.ti-community-sr {
	position: absolute;
	/* Never seen, but read by contrast tools: give it the field's own pair. */
	background: var( --ti-field );
	color: var( --ti-strong );
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.ti-community-icon {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	fill: none;
	stroke: currentcolor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ti-community-join :where( h1, h2 ),
.ti-community-entry :where( h1 ) {
	margin: 0;
	color: var( --ti-strong );
	font-family: var( --wp--preset--font-family--display );
	font-weight: 400;
	line-height: 1.08;
	letter-spacing: -0.02em;
	hyphens: manual;
}

.ti-community-join p,
.ti-community-entry p {
	margin: 0;
}

.ti-community-join a:not( .ti-community-button ),
.ti-community-entry a:not( .ti-community-button ) {
	color: var( --ti-strong );
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

.ti-community-join a:not( .ti-community-button ):hover,
.ti-community-entry a:not( .ti-community-button ):hover {
	color: var( --ti-flare );
}

.ti-community-join :focus-visible,
.ti-community-entry :focus-visible {
	outline: 2px solid var( --ti-strong );
	outline-offset: 3px;
}

/* Buttons ------------------------------------------------------------------------------- */

.ti-community-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.ti-community-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 3.25rem;
	padding: 0 1.4rem;
	border: 1px solid transparent;
	border-radius: 0;
	background: transparent;
	color: var( --ti-strong );
	font: 600 1.0625rem/1 var( --wp--preset--font-family--body );
	text-decoration: none;
	cursor: pointer;
	transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.ti-community-button .ti-community-icon {
	width: 1.15rem;
	height: 1.15rem;
}

.ti-community-button--flare {
	background: var( --ti-flare );
	color: var( --ti-field );
}

.ti-community-button--flare:hover {
	background: color-mix( in srgb, var( --ti-flare ) 82%, var( --ti-strong ) );
}

.ti-community-button--secondary {
	border-color: var( --ti-strong );
}

.ti-community-button--secondary:hover {
	background: var( --ti-strong );
	color: var( --ti-field );
}

.ti-community-button--quiet {
	min-height: 44px;
	padding: 0 0.9rem;
	border-color: var( --ti-community-edge );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-button--quiet:hover {
	border-color: var( --ti-strong );
}

.ti-community-button--wide {
	width: 100%;
}

/*
 * The one action that removes: the error tone as a fill under the field's colour (#080808 on about
 * #E2968F, 8.6:1), and as an edge and text on the quiet variant (8.6:1 on the field).
 */
.ti-community-button--danger {
	background: var( --ti-community-error );
	color: var( --ti-field );
}

.ti-community-button--danger:hover {
	background: color-mix( in srgb, var( --ti-community-error ) 80%, var( --ti-strong ) );
}

.ti-community-button--danger-quiet {
	min-height: 44px;
	padding: 0 0.9rem;
	border-color: var( --ti-community-error );
	color: var( --ti-community-error );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-button--danger-quiet:hover {
	background: var( --ti-community-error );
	color: var( --ti-field );
}

/* The invitation ------------------------------------------------------------------------ */

.ti-community-join__invite {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: clamp( 3.5rem, 8vw, 5.5rem );
}

/* The one warm light of the screen, behind the stage side. Decoration only, never content. */
.ti-community-join__glow {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient( 45% 60% at 78% 50%, color-mix( in srgb, var( --ti-flare ) 22%, transparent ), transparent 70% );
}

.ti-community-join__hero {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 3.5rem;
	align-items: center;
}

.ti-community-join__hero.has-examples {
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1.1fr );
}

.ti-community-join__pitch {
	display: grid;
	justify-items: start;
	gap: 1.5rem;
	max-width: 44rem;
}

.ti-community-join__title {
	max-width: 14ch;
	font-size: clamp( 2.8rem, 6vw, 5.4rem );
	line-height: 0.95;
	letter-spacing: -0.035em;
	text-wrap: balance;
}

.ti-community-join__lede {
	max-width: 34rem;
	color: var( --ti-quiet );
	font-size: var( --wp--preset--font-size--large, 1.35rem );
	line-height: 1.45;
}

.ti-community-join__pitch .ti-community-actions {
	margin-block-start: 0.75rem;
}

.ti-community-join__note {
	color: var( --ti-muted );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

/* What comes in a profile --------------------------------------------------------------- */

.ti-community-join__what {
	display: grid;
	grid-template-columns: minmax( 0, 1.1fr ) minmax( 0, 1fr );
	gap: 3.5rem;
	padding-block: 3.5rem;
	border-top: 1px solid var( --ti-line );
}

.ti-community-join__heading {
	margin-block-end: 1.5rem;
	font-size: var( --wp--preset--font-size--x-large, 2.35rem );
}

.ti-community-join__list {
	display: grid;
	gap: 0.75rem;
	max-width: 42rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ti-community-join__list li {
	display: grid;
	grid-template-columns: 1.5rem minmax( 0, 1fr );
	gap: 0.75rem;
	color: var( --ti-quiet );
	line-height: 1.6;
}

.ti-community-join__list .ti-community-icon {
	margin-block-start: 0.2rem;
	color: var( --ti-flare );
}

.ti-community-join__list strong {
	color: var( --ti-strong );
	font-weight: 600;
}

.ti-community-join__played {
	display: grid;
	align-content: start;
	gap: 1.5rem;
}

.ti-community-seal {
	display: grid;
	place-items: center;
	width: 9rem;
	aspect-ratio: 1;
	padding: 0.75rem;
	border: 1px solid var( --ti-flare );
	border-radius: 50%;
	color: var( --ti-flare );
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.ti-community-join__played-text {
	max-width: 32rem;
	color: var( --ti-quiet );
	font-size: var( --wp--preset--font-size--large, 1.35rem );
	line-height: 1.45;
}

/* Step 1 ---------------------------------------------------------------------------------- */

.ti-community-join__step {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 3.5rem;
	align-items: start;
	padding-block: 3.5rem clamp( 4rem, 9vw, 6.5rem );
	border-top: 1px solid var( --ti-line );
	scroll-margin-top: 1rem;
}

.ti-community-join__step.has-preview {
	grid-template-columns: minmax( 0, 1fr ) 22rem;
}

.ti-community-steps {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}

.ti-community-steps__bar {
	display: flex;
	flex: 0 1 13rem;
	min-width: 0;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ti-community-steps__bar li {
	flex: 1 1 3rem;
	min-width: 0.75rem;
	height: 4px;
	background: var( --ti-line );
}

.ti-community-steps__bar li[aria-current="step"] {
	background: var( --ti-flare );
}

.ti-community-steps__label {
	color: var( --ti-muted );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

/* Forms --------------------------------------------------------------------------------- */

.ti-community-form {
	display: grid;
	gap: 1.5rem;
	max-width: 36rem;
}

.ti-community-form__title {
	font-size: var( --wp--preset--font-size--x-large, 2.35rem );
}

.ti-community-form__lede,
.ti-community-form__note {
	color: var( --ti-muted );
}

.ti-community-form__note {
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-field {
	display: grid;
	gap: 0.4rem;
}

.ti-community-field > label {
	font-size: var( --wp--preset--font-size--small, 0.875rem );
	font-weight: 600;
}

.ti-community-field input[type="text"],
.ti-community-field input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var( --ti-community-edge );
	border-radius: 0;
	background: var( --ti-well );
	color: var( --ti-strong );
	font: 400 1rem/1.4 var( --wp--preset--font-family--body );
}

.ti-community-field input[type="text"]:focus-visible,
.ti-community-field input[type="email"]:focus-visible {
	outline-offset: 2px;
}

.ti-community-field.has-error input[type="text"],
.ti-community-field.has-error input[type="email"] {
	border-color: var( --ti-community-error );
}

.ti-community-field__hint {
	color: var( --ti-muted );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-field__error,
.ti-community-field__ok {
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
	font-size: var( --wp--preset--font-size--small, 0.875rem );
	line-height: 1.45;
}

.ti-community-field__error {
	color: var( --ti-community-error );
}

.ti-community-field__ok {
	color: var( --ti-quiet );
}

.ti-community-field__ok .ti-community-icon {
	color: var( --ti-flare );
}

.ti-community-field__ok[hidden] {
	display: none;
}

.ti-community-address {
	overflow-wrap: anywhere;
}

.ti-community-address strong {
	color: var( --ti-strong );
	font-weight: 600;
}

/*
 * The consent box: the native checkbox stays focusable but off screen (as the theme's scheme control
 * does), and the label draws a 24 px box inside a target of at least 44 px. The sentence sits in a
 * paragraph, so its two links read as links inside prose. Checked is said by the fill and the tick,
 * never by hue alone.
 */
.ti-community-check {
	position: relative;
	margin: 0;
}

.ti-community-check__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.ti-community-check__label {
	display: grid;
	grid-template-columns: 1.5rem minmax( 0, 1fr );
	gap: 0.75rem;
	align-items: start;
	min-height: 44px;
	padding-block: 0.6rem;
	color: var( --ti-quiet );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
	line-height: 1.5;
	cursor: pointer;
}

.ti-community-check__box {
	box-sizing: border-box;
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border: 1px solid var( --ti-community-edge );
	background: var( --ti-well );
	color: var( --ti-field );
}

.ti-community-check__box .ti-community-icon {
	width: 1rem;
	height: 1rem;
	stroke-width: 2.25;
	visibility: hidden;
}

.ti-community-check__input:checked + .ti-community-check__label .ti-community-check__box {
	border-color: var( --ti-flare );
	background: var( --ti-flare );
}

.ti-community-check__input:checked + .ti-community-check__label .ti-community-check__box .ti-community-icon {
	visibility: visible;
}

.ti-community-field.has-error .ti-community-check__box {
	border-color: var( --ti-community-error );
}

.ti-community-check:has( > .ti-community-check__input:focus-visible ) {
	outline: 2px solid var( --ti-strong );
	outline-offset: 3px;
}

/* The report's reasons: the same box, round, with a dot when chosen. */
.ti-community-reasons {
	margin: 0;
	padding: 0;
	border: 0;
	gap: 0;
}

.ti-community-reasons legend {
	margin-bottom: 0.4rem;
	padding: 0;
	font-size: var( --wp--preset--font-size--small, 0.875rem );
	font-weight: 600;
}

.ti-community-check--radio .ti-community-check__label {
	color: var( --ti-strong );
	font-size: 1rem;
}

.ti-community-check--radio .ti-community-check__box {
	border-radius: 50%;
}

.ti-community-check--radio .ti-community-check__input:checked + .ti-community-check__label .ti-community-check__box {
	border-color: var( --ti-flare );
	background: var( --ti-well );
	box-shadow: inset 0 0 0 0.3rem var( --ti-well ), inset 0 0 0 1rem var( --ti-flare );
}

.ti-community-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 8rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var( --ti-community-edge );
	border-radius: 0;
	background: var( --ti-well );
	color: var( --ti-strong );
	font: 400 1rem/1.5 var( --wp--preset--font-family--body );
	resize: vertical;
}

.ti-community-field textarea:focus-visible {
	outline-offset: 2px;
}

.ti-community-field.has-error textarea {
	border-color: var( --ti-community-error );
}

.ti-community-field__hint [data-count] {
	font-variant-numeric: tabular-nums;
}

.ti-community-honeypot {
	position: absolute;
	left: -9999px;
	/* Off screen and out of every tree; a bot reading the HTML still finds the field. */
	visibility: hidden;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ti-community-summary {
	display: grid;
	gap: 0.5rem;
	padding: 1rem 1.5rem;
	border-inline-start: 2px solid var( --ti-community-error );
	background: var( --ti-well );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-summary__title {
	font-weight: 600;
}

.ti-community-summary ul {
	display: grid;
	gap: 0.25rem;
	margin: 0;
	padding-inline-start: 1.1rem;
}

.ti-community-summary a {
	display: block;
	padding-block: 0.75rem;
	color: var( --ti-community-error );
}

/* Entry screens ------------------------------------------------------------------------- */

.ti-community-entry__inner {
	display: grid;
	justify-items: start;
	gap: 1.5rem;
	padding-block: clamp( 3.5rem, 8vw, 5.5rem ) clamp( 4.5rem, 10vw, 7rem );
}

.ti-community-entry__inner > * {
	max-width: 38rem;
}

.ti-community-entry__title {
	max-width: 18ch;
	font-size: clamp( 2.4rem, 5vw, 3.6rem );
	letter-spacing: -0.03em;
	line-height: 1.04;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.ti-community-entry__text {
	color: var( --ti-quiet );
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.ti-community-entry__note {
	color: var( --ti-muted );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-entry .ti-community-form {
	width: 100%;
}

.ti-community-entry__form {
	margin: 0;
}

.ti-community-entry__form .ti-community-button span {
	overflow-wrap: anywhere;
}

.ti-community-callout {
	display: grid;
	grid-template-columns: 1.5rem minmax( 0, 1fr );
	gap: 0.75rem;
	width: 100%;
	padding: 1rem 1.5rem;
	border-inline-start: 2px solid var( --ti-flare );
	background: var( --ti-well );
	color: var( --ti-quiet );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-callout .ti-community-icon {
	color: var( --ti-flare );
}

/* Terms of the artist profiles ---------------------------------------------------------- */

/*
 * A reading page on the same field: the measure kept to about 68 characters, headings in the
 * display face at the h2 step, and the version line muted at the foot.
 */
.ti-terms {
	display: grid;
	gap: 1rem;
	padding-block: clamp( 3.5rem, 8vw, 5.5rem ) clamp( 4.5rem, 10vw, 7rem );
}

.ti-terms > * {
	max-width: 42rem;
}

.ti-terms__head {
	display: grid;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.ti-terms__title {
	max-width: 20ch;
	font-size: clamp( 2.2rem, 5vw, 3.6rem );
	letter-spacing: -0.03em;
	line-height: 1.04;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.ti-terms__lede {
	color: var( --ti-quiet );
	font-size: 1.125rem;
	line-height: 1.55;
}

.ti-community-entry .ti-terms__heading {
	margin: 1.75rem 0 0;
	font-family: var( --wp--preset--font-family--display );
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.ti-terms p {
	color: var( --ti-quiet );
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.ti-terms__more {
	margin-top: 1.75rem;
}

.ti-terms__version {
	padding-top: 1rem;
	border-top: 1px solid var( --ti-line );
	font-size: var( --wp--preset--font-size--small, 0.875rem );
}

.ti-community-entry .ti-terms__version {
	color: var( --ti-muted );
}

/* Narrow screens ------------------------------------------------------------------------ */

@media ( max-width: 64rem ) {
	.ti-community-join__hero.has-examples,
	.ti-community-join__what,
	.ti-community-join__step.has-preview {
		grid-template-columns: minmax( 0, 1fr );
	}

	.ti-community-join__what {
		gap: 2.25rem;
	}
}

@media ( max-width: 30rem ) {
	.ti-community-join__pitch .ti-community-actions .ti-community-button {
		flex: 1 1 auto;
	}

	.ti-community-seal {
		width: 7.5rem;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ti-community-button {
		transition: none;
	}
}
