/*
 * Groove Site — the announcement (inc/announcement.php). Loads on every
 * page while a page is announced, except that page itself, and on any page
 * whose content uses the announcement pattern. Also an editor style.
 *
 *   1. the banner, first in the body, above the header on every template;
 *   2. the dialog the announced page opens in;
 *   3. the morph between them (assets/js/announcement.js): the dialog's
 *      panel and the banner share one view-transition name, so closing
 *      shrinks the panel into the banner and "Learn more" grows it back;
 *   4. the showcase (patterns/announcement-creative.php, and page-release.php
 *      for a release's own page), laid out by container queries, since the
 *      dialog is narrower than the window.
 *
 * Relies on global.css for --gs-ease, --gs-rule, --gs-noise, .gs-kicker
 * and the dark scheme's preset colours.
 */

/* ---------------------------------------------------------------- tokens */

/*
 * --gs-signal-on-ink: the one signal colour that reads as text (4.5:1) on
 * a surface painted in the scheme's ink, the banner and the inverse cell:
 * orange on night in the light scheme, violet on paper in the dark (red and
 * orange fall under 3:1 on paper).
 */
:root {
	--gs-signal-on-ink: var(--wp--preset--color--accent-2);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) {
		--gs-signal-on-ink: var(--wp--preset--color--accent-3);
	}
}

:root[data-scheme="dark"] {
	--gs-signal-on-ink: var(--wp--preset--color--accent-3);
}

/* ---------------------------------------------------------------- banner */

/*
 * The page fills the window with the banner above it: the body takes the
 * window's height and the site blocks the rest, in place of the 100dvh
 * global.css gives .wp-site-blocks alone.
 */
body:has(> .gs-announce:not([hidden])) {
	display: flex;
	flex-direction: column;
	min-block-size: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

body:has(> .gs-announce:not([hidden])) > .wp-site-blocks {
	flex-grow: 1;
	min-block-size: 0;
}

/*
 * Ink on paper turned over: an ink strip with paper type, in either scheme,
 * as the scheme toggle's tooltip is. It reads as news about the site rather
 * than part of the page, and stands apart even on the landing template,
 * which has no header rule under it. A small swatch of the signal gradient
 * is its only colour.
 */
.gs-announce {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
}

.gs-announce[hidden] {
	display: none;
}

.gs-announce__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 1.25rem;
	min-block-size: 2.75rem;
	padding: 0.25rem var(--wp--preset--spacing--gutter);
}

.gs-announce__line {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0;
	padding-block: 0.375rem;
	font-weight: 500;
}

.gs-announce__mark {
	position: relative;
	flex-shrink: 0;
	inline-size: 0.75em;
	block-size: 0.75em;
	background-image: var(--gs-gradient);
}

/*
 * The signal: a soft light in the signal colours circles the square. It
 * sits behind the square (the line is its own stacking context, so z-index
 * -1 stays above the banner's background). Transform and opacity only, and
 * none of it when motion is reduced.
 *
 * Motion that starts by itself and lasts over five seconds needs a way to
 * stop it (WCAG 2.2.2). With script, dismissing the banner is that way, so
 * the light fades in and keeps circling, slowly, for as long as the banner
 * is up (Frank's choice, 2026-10-21). Without script there is no dismiss
 * button, so it circles twice, fading in and out, under five seconds. It
 * restarts when the dialog shrinks into the banner (assets/js/announcement.js),
 * to lead the eye there.
 */
.gs-announce__line {
	isolation: isolate;
}

.gs-announce__mark::after {
	content: "";
	position: absolute;
	inset: -0.45em;
	z-index: -1;
	border-radius: 50%;
	background-image: conic-gradient(
		from 0deg,
		transparent 0turn,
		var(--wp--preset--color--accent-1) 0.18turn,
		var(--wp--preset--color--accent-2) 0.32turn,
		transparent 0.5turn
	);
	filter: blur(3px);
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	.gs-announce__mark::after {
		animation: gs-announce-orbit-once 4.8s linear 0.6s both;
	}

	.gs-js .gs-announce__mark::after {
		opacity: 0.6;
		animation:
			gs-announce-glow 1.2s var(--gs-ease) 0.6s both,
			gs-announce-orbit 6s linear infinite;
	}
}

@media (forced-colors: active) {
	.gs-announce__mark::after {
		display: none;
	}
}

@keyframes gs-announce-glow {
	from {
		opacity: 0;
	}
}

@keyframes gs-announce-orbit {
	to {
		rotate: 360deg;
	}
}

@keyframes gs-announce-orbit-once {
	0% {
		opacity: 0;
		rotate: 0deg;
	}

	15%,
	75% {
		opacity: 0.7;
	}

	100% {
		opacity: 0;
		rotate: 720deg;
	}
}

@media (forced-colors: active) {
	.gs-announce__mark {
		background: CanvasText;
	}
}

.gs-announce__more {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-block-size: 2.75rem; /* 44px touch target */
	/* The action, in colour, apart from the line beside it. */
	color: var(--gs-signal-on-ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.gs-announce__more:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.gs-announce__more .gs-arrow {
	transition: translate 0.3s var(--gs-ease);
}

.gs-announce__more:hover .gs-arrow {
	translate: 3px 0;
}

.gs-announce__more:dir(rtl) .gs-arrow {
	scale: -1 1;
}

/* At the far end, whether or not the row wraps. */
.gs-announce__close {
	display: inline-grid;
	place-items: center;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	margin-inline: auto -0.75rem;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.3s;
}

.gs-announce__close:is(:hover, :focus-visible) {
	opacity: 1;
}

.gs-announce__close[hidden] {
	display: none;
}

/* Hold its space until the script reveals it, so the row does not shift. */
.gs-js .gs-announce__close[hidden] {
	display: inline-grid;
	visibility: hidden;
}

/* ---------------------------------------------------------------- dialog */

/*
 * Almost the whole window, a gutter clear of each edge, so the page stays
 * just visible behind a blurred scrim and it is plain this sits over it.
 * The panel is the page's own paper with a poster rule round it; the label
 * bar is the video dialog's, then the page's content, which scrolls.
 */
.gs-announce-dialog {
	--gs-announce-gap: var(--wp--preset--spacing--gutter);
	inline-size: min(84rem, 100vw - 2 * var(--gs-announce-gap));
	block-size: calc(100dvh - 2 * var(--gs-announce-gap));
	max-inline-size: none;
	max-block-size: none;
	margin: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	background: none;
	color: var(--wp--preset--color--ink);
}

/* The title takes focus on opening, to be read, not operated: no ring. */
.gs-announce-dialog__title:focus {
	outline: none;
}

.gs-announce-dialog::backdrop {
	background-color: var(--gs-scrim);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

html:has(.gs-announce-dialog[open]) {
	overflow: hidden;
}

.gs-announce-dialog__panel {
	display: flex;
	flex-direction: column;
	block-size: 100%;
	background-color: var(--wp--preset--color--base);
	background-image: var(--gs-noise);
	border: var(--gs-rule) solid var(--wp--preset--color--ink);
}

.gs-announce-dialog__bar {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-inline: var(--wp--preset--spacing--gutter);
	border-block-end: var(--gs-rule) solid var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.gs-announce-dialog__title {
	min-inline-size: 0;
	margin: 0;
	overflow: hidden;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gs-announce-dialog__close {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.6em;
	min-block-size: 2.75rem; /* 44px touch target */
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.3s;
}

.gs-announce-dialog__close:is(:hover, :focus-visible) {
	opacity: 1;
}

.gs-announce-dialog__x {
	font-size: 1.1em;
	transition: rotate 0.3s var(--gs-ease);
}

.gs-announce-dialog__close:hover .gs-announce-dialog__x {
	rotate: 90deg;
}

.gs-announce-dialog__body {
	flex-grow: 1;
	min-block-size: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-block: var(--wp--preset--spacing--50);
}

/*
 * Reading progress: the rule under the bar becomes a faint track that the
 * signal run fills as the body scrolls, from the start edge, as the site
 * header's rule does with the page (global.css, whose gs-fill this uses).
 * The body names its scroll timeline and the panel lifts the name's scope
 * to itself, so the bar, the body's sibling, can follow it. Decorative, so
 * where scroll timelines are missing the rule simply stays ink.
 */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: scroll()) and (timeline-scope: none) {
		.gs-announce-dialog__panel {
			timeline-scope: --gs-announce-scroll;
		}

		.gs-announce-dialog__body {
			scroll-timeline: --gs-announce-scroll block;
		}

		.gs-announce-dialog__bar {
			border-block-end-color: var(--wp--preset--color--line);
		}

		.gs-announce-dialog__bar::after {
			content: "";
			position: absolute;
			inset-inline: 0;
			inset-block-end: calc(var(--gs-rule) * -1);
			block-size: var(--gs-rule);
			background-image: linear-gradient(to right, var(--gs-rise));
			animation: gs-fill linear both;
			animation-timeline: --gs-announce-scroll;
		}

		[dir="rtl"] .gs-announce-dialog__bar::after {
			scale: -1 1;
		}
	}
}

@media (forced-colors: active) {
	.gs-announce-dialog__bar::after {
		background: CanvasText;
	}
}

/* The page's last block ends on the panel's padding, not its own margin. */
.gs-announce-dialog__body > :last-child {
	margin-block-end: 0;
}

/*
 * Opening on load: the panel comes up out of a blur and the scrim fades in
 * under it, as the video dialog does. Closing and reopening are the morph
 * below, which turns these off while it runs.
 */
@media (prefers-reduced-motion: no-preference) {
	.gs-announce-dialog,
	.gs-announce-dialog::backdrop {
		transition:
			opacity 0.25s var(--gs-ease),
			translate 0.25s var(--gs-ease),
			filter 0.25s var(--gs-ease),
			display 0.25s allow-discrete,
			overlay 0.25s allow-discrete;
	}

	.gs-announce-dialog[open],
	.gs-announce-dialog[open]::backdrop {
		transition-duration: 0.7s;
	}

	.gs-announce-dialog:not([open]),
	.gs-announce-dialog:not([open])::backdrop {
		opacity: 0;
	}

	@starting-style {
		.gs-announce-dialog[open],
		.gs-announce-dialog[open]::backdrop {
			opacity: 0;
		}

		.gs-announce-dialog[open] {
			translate: 0 2rem;
			filter: blur(8px);
		}
	}

	html.gs-announce-morphing :is(.gs-announce-dialog, .gs-announce-dialog::backdrop) {
		transition: none;
	}
}

/* ----------------------------------------------------------------- morph */

/*
 * One name, on whichever of the two is showing. The browser animates the
 * box between them; both snapshots keep their own size (object-fit: none,
 * so neither is stretched) and are cropped to the box from the top, so the
 * panel's label bar is what lands in the banner's place.
 */
.gs-announce-dialog[open] .gs-announce-dialog__panel,
html:not(:has(.gs-announce-dialog[open])) .gs-announce {
	view-transition-name: gs-announce;
}

::view-transition-group(gs-announce) {
	animation-duration: 0.45s;
	animation-timing-function: var(--gs-ease);
}

::view-transition-image-pair(gs-announce) {
	overflow: hidden;
}

::view-transition-old(gs-announce),
::view-transition-new(gs-announce) {
	block-size: 100%;
	object-fit: none;
	object-position: top;
}

/* -------------------------------------------------------------- showcase */

/*
 * A poster sheet in four bands: the masthead beside Fig. 01, the steps of
 * a project, a ruled grid of what it does, and the sign-off. Sized by its
 * own width (the dialog's or the page's), never the window's.
 */
.gs-showcase {
	--gs-cell-pad: clamp(1.25rem, 3cqi, 2.25rem);
	container: gs-showcase / inline-size;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--60);
	max-inline-size: 84rem;
	margin-inline: auto;
}

/*
 * On a page of its own, the page template holds content to the reading
 * column, wide blocks included; the sheet steps out of it to the wide
 * size, centred on the window. (body clips any sideways overflow.)
 */
.wp-block-post-content > .gs-showcase {
	position: relative;
	left: 50%;
	inline-size: min(84rem, 100vw - 2 * var(--wp--preset--spacing--gutter));
	max-inline-size: none;
	translate: -50% 0;
}

.gs-showcase > *,
.gs-showcase__grid > *,
.gs-showcase__hero > *,
.gs-showcase__intro > *,
.gs-showcase__section > *,
.gs-cell > * {
	margin-block: 0;
}

.gs-showcase__section {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.gs-showcase figure {
	margin: 0;
}

.gs-showcase figcaption {
	margin-block-start: 0.75rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--muted);
	text-align: start;
}

.gs-showcase figcaption strong {
	margin-inline-end: 0.5em;
	color: var(--wp--preset--color--ink);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.gs-showcase img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

/* ---- masthead */

.gs-showcase__hero {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	align-items: end;
}

.gs-showcase__intro {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* The banner's swatch, so the overlay reads as the banner opened up. */
.gs-showcase__mark {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--wp--preset--color--ink);
}

.gs-showcase__mark::before {
	content: "";
	flex-shrink: 0;
	inline-size: 0.875em;
	block-size: 0.875em;
	background-image: var(--gs-gradient);
}

@media (forced-colors: active) {
	.gs-showcase__mark::before {
		background: CanvasText;
	}
}

/*
 * The Folios masthead's weight and caps, starting in ink and warming
 * towards the end of "Creative", as the header logotype does. Only colours
 * that hold 3:1 on the scheme's base (large text) are in the run, and no
 * violet: on paper, red deepened with a little ink (3.77:1; red alone is
 * 2.85:1 and orange 1.7:1 there); on night, orange then red.
 * Fit to the text, so the run ends where "Creative" does, not at the column.
 */
.gs-showcase {
	--gs-title-run: var(--wp--preset--color--ink) 0% 45%, color-mix(in oklab, var(--wp--preset--color--accent-1) 85%, var(--wp--preset--color--ink)) 100%;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) .gs-showcase {
		--gs-title-run: var(--wp--preset--color--ink) 0% 45%, var(--wp--preset--color--accent-2) 75%, var(--wp--preset--color--accent-1) 100%;
	}
}

:root[data-scheme="dark"] .gs-showcase {
	--gs-title-run: var(--wp--preset--color--ink) 0% 45%, var(--wp--preset--color--accent-2) 75%, var(--wp--preset--color--accent-1) 100%;
}

.gs-showcase__title {
	inline-size: fit-content;
	font-size: clamp(2.75rem, 1rem + 6.5cqi, 7rem);
	font-weight: 900;
	letter-spacing: -0.045em;
	line-height: 0.86;
	text-transform: uppercase;
	text-wrap: nowrap;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
	.gs-showcase__title {
		background-image: linear-gradient(115deg, var(--gs-title-run));
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
	}
}

@media (forced-colors: active) {
	.gs-showcase__title {
		background: none;
		color: CanvasText;
	}
}

.gs-showcase__pitch {
	max-inline-size: 26ch;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	line-height: 1.25;
	text-wrap: balance;
}

/* Screenshots: a hairline frame, square, no shadow. */
:is(.gs-bleed, .gs-crop) img {
	border: 1px solid var(--wp--preset--color--line);
}

@container gs-showcase (min-width: 56rem) {
	.gs-showcase__hero {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	}

	/* Fig. 01 runs off the sheet's far edge, into the page's gutter. */
	.gs-showcase__hero > .gs-bleed {
		margin-inline-end: calc(-1 * var(--wp--preset--spacing--gutter));
	}

	.gs-showcase__hero > .gs-bleed img {
		border-inline-end: 0;
	}
}

/* ---- the steps */

/*
 * Numbered by the list itself, on an ink rule that the signal colours draw
 * along once the sheet is in view: the header rule's motif, run once.
 */
.gs-showcase__loop {
	position: relative;
	display: grid;
	gap: 0 var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: gs-step;
	border-block-start: var(--gs-rule) solid var(--wp--preset--color--ink);
}

.gs-showcase__loop::before {
	content: "";
	position: absolute;
	inset: calc(-1 * var(--gs-rule)) 0 auto;
	block-size: var(--gs-rule);
	background-image: var(--gs-gradient);
	transform-origin: left;
}

.gs-showcase__loop:dir(rtl)::before {
	transform-origin: right;
}

.gs-showcase__loop > li {
	counter-increment: gs-step;
	margin: 0;
	padding-block: 1.25rem;
	border-block-end: 1px solid var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.gs-showcase__loop > li::before {
	content: counter(gs-step, decimal-leading-zero);
	display: block;
	margin-block-end: 0.75rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--ink);
}

.gs-showcase__loop > li strong {
	display: block;
	margin-block-end: 0.375rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--wp--preset--color--ink);
}

@container gs-showcase (min-width: 40rem) {
	.gs-showcase__loop {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container gs-showcase (min-width: 64rem) {
	.gs-showcase__loop {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.gs-showcase__loop > li {
		border-block-end: 0;
	}
}

/* ---- the grid */

/*
 * Ruled like a printed spec sheet: the gaps are the ink showing through.
 * One column, then six, then twelve; --wide and --tall cells take more,
 * and dense packing fills the holes a reordered grid would leave.
 */
.gs-showcase__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gs-rule);
	background-color: var(--wp--preset--color--ink);
	border: var(--gs-rule) solid var(--wp--preset--color--ink);
}

.gs-cell {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	min-inline-size: 0;
	padding: var(--gs-cell-pad);
	/* clip, not hidden: hidden makes a scroll container, and the scroll-
	   driven motion inside would track this box instead of the dialog body. */
	overflow: clip;
	background-color: var(--wp--preset--color--base);
	background-image: var(--gs-noise);
	color: var(--wp--preset--color--ink);
}

.gs-cell h3 {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.gs-cell p:not(.gs-kicker) {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
}

/* An image to the cell's far corner: past its padding, cropped by it. */
.gs-cell > .gs-bleed {
	margin-block: auto calc(-1 * var(--gs-cell-pad));
	margin-inline-end: calc(-1 * var(--gs-cell-pad));
	padding-block-start: 0.5rem;
}

.gs-cell > .gs-bleed img {
	border-inline-end: 0;
	border-block-end: 0;
}

/* A tall screenshot, shown from the top. */
.gs-cell > .gs-crop {
	margin-block-start: auto;
}

.gs-crop img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	object-position: top;
}

/*
 * The one loud moment: the phone on the signal gradient, run to the cell's
 * edges and cut off at the bottom, as if set into the sheet. The stage is
 * a size container so the phone can be sized from its height (40cqb makes
 * it taller than the stage), however tall the grid row makes the stage.
 */
.gs-cell > .gs-stage {
	container-type: size;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	block-size: clamp(22rem, 70cqi, 34rem);
	margin: 0.5rem calc(-1 * var(--gs-cell-pad)) calc(-1 * var(--gs-cell-pad));
	padding: var(--gs-cell-pad) var(--gs-cell-pad) 0;
	overflow: clip;
	background-image: var(--gs-gradient);
}

.gs-stage img {
	flex-shrink: 0;
	inline-size: min(100%, max(min(78%, 20rem), 40cqb));
	border: var(--gs-rule) solid var(--wp--preset--color--night);
	border-block-end: 0;
}

@media (forced-colors: active) {
	.gs-cell > .gs-stage {
		background: Canvas;
	}
}

/*
 * The scheme turned over, as the banner is: night in the light scheme,
 * paper in the dark, so it stands out of the grid in both. Its accent is
 * --gs-signal-on-ink, which already follows the scheme the same way.
 */
.gs-cell--inverse {
	--wp--preset--color--base: var(--wp--preset--color--night);
	--wp--preset--color--ink: var(--wp--preset--color--paper);
	--wp--preset--color--muted: color-mix(in srgb, var(--wp--preset--color--paper) 68%, var(--wp--preset--color--night));
	--wp--preset--color--line: color-mix(in srgb, var(--wp--preset--color--paper) 18%, transparent);
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) .gs-cell--inverse {
		--wp--preset--color--base: var(--wp--preset--color--paper);
		--wp--preset--color--ink: var(--wp--preset--color--night);
		--wp--preset--color--muted: color-mix(in srgb, var(--wp--preset--color--night) 70%, var(--wp--preset--color--paper));
		--wp--preset--color--line: color-mix(in srgb, var(--wp--preset--color--night) 15%, transparent);
		color-scheme: light;
	}
}

:root[data-scheme="dark"] .gs-cell--inverse {
	--wp--preset--color--base: var(--wp--preset--color--paper);
	--wp--preset--color--ink: var(--wp--preset--color--night);
	--wp--preset--color--muted: color-mix(in srgb, var(--wp--preset--color--night) 70%, var(--wp--preset--color--paper));
	--wp--preset--color--line: color-mix(in srgb, var(--wp--preset--color--night) 15%, transparent);
	color-scheme: light;
}

/* A channel's messages, as a plain mono log: a channel and a line each. */
.gs-feed {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	line-height: 1.5;
}

.gs-feed > li {
	margin: 0;
	padding-block: 0.625rem;
	border-block-start: 1px solid var(--wp--preset--color--line);
}

.gs-feed > li:last-child {
	border-block-end: 1px solid var(--wp--preset--color--line);
}

.gs-feed strong {
	display: block;
	color: var(--gs-signal-on-ink);
	font-weight: 700;
}

/* Answer types, as the labels on a specimen drawer. */
.gs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gs-chips > li {
	margin: 0;
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
}

@container gs-showcase (min-width: 40rem) {
	.gs-showcase__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.gs-cell {
		grid-column: span 3;
	}

	.gs-cell--wide,
	.gs-cell--tall {
		grid-column: span 6;
	}

	/*
	 * A cell left alone on the last row takes the row, so no ink shows. It is
	 * alone only if it is odd among the half-width cells: an even one has a
	 * partner beside it.
	 */
	.gs-cell:nth-child(odd of .gs-cell:not(.gs-cell--wide, .gs-cell--tall)):last-child {
		grid-column: 1 / -1;
	}
}

@container gs-showcase (min-width: 64rem) {
	.gs-showcase__grid {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		grid-auto-flow: dense;
	}

	.gs-cell,
	.gs-cell:nth-child(odd of .gs-cell:not(.gs-cell--wide, .gs-cell--tall)):last-child {
		grid-column: span 4;
	}

	.gs-cell--wide {
		grid-column: span 8;
	}

	.gs-cell--tall {
		grid-column: span 4;
		grid-row: span 2;
	}

	/* As tall as the two rows leave it. */
	.gs-cell--tall > .gs-stage {
		flex: 1 1 0;
		block-size: auto;
		min-block-size: 22rem;
	}
}

/* ---- the sign-off */

.gs-showcase__end {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding-block-end: var(--wp--preset--spacing--30);
}

.gs-showcase__end p {
	max-inline-size: 44ch;
	color: var(--wp--preset--color--muted);
}

/*
 * In the overlay, each opening sets the top of the sheet: the masthead,
 * then Fig. 01, a beat apart. These start whenever the dialog opens, since
 * a closed dialog renders nothing.
 *
 * Below that, where scroll timelines exist, the sheet keeps moving as it is
 * read: each step, cell and the sign-off rise as they scroll into the body
 * (done once 12rem is in, as on the landing page), the signal rule draws
 * along the steps as they arrive, and the phone drifts up its stage. Where
 * they do not, those rise on opening too, a beat apart. On the page itself
 * the sheet simply stands.
 */
@media (prefers-reduced-motion: no-preference) {
	.gs-announce-dialog :is(.gs-showcase__intro > *, .gs-showcase__hero > figure) {
		animation: gs-showcase-in 0.8s var(--gs-ease) both;
	}

	.gs-announce-dialog .gs-showcase__intro > :nth-child(2) { animation-delay: 0.06s; }
	.gs-announce-dialog .gs-showcase__intro > :nth-child(3) { animation-delay: 0.12s; }
	.gs-announce-dialog .gs-showcase__intro > :nth-child(n + 4) { animation-delay: 0.18s; }
	.gs-announce-dialog .gs-showcase__hero > figure { animation-delay: 0.22s; }

	@supports (animation-timeline: view()) {
		.gs-announce-dialog :is(.gs-showcase__loop > li, .gs-cell, .gs-showcase__end) {
			animation: gs-showcase-in var(--gs-ease) both;
			animation-timeline: view();
			animation-range: entry 0% entry min(100%, 12rem);
		}

		.gs-announce-dialog .gs-showcase__loop {
			view-timeline: --gs-showcase-loop block;
		}

		.gs-announce-dialog .gs-showcase__loop::before {
			animation: gs-showcase-draw linear both;
			animation-timeline: --gs-showcase-loop;
			animation-range: entry 0% cover 40%;
		}

		.gs-announce-dialog .gs-stage {
			view-timeline: --gs-showcase-stage block;
		}

		.gs-announce-dialog .gs-stage img {
			animation: gs-showcase-drift linear both;
			animation-timeline: --gs-showcase-stage;
			animation-range: cover;
		}
	}

	@supports not (animation-timeline: view()) {
		.gs-announce-dialog :is(.gs-showcase__loop > li, .gs-cell, .gs-showcase__end) {
			animation: gs-showcase-in 0.8s var(--gs-ease) both;
		}

		.gs-announce-dialog .gs-showcase__loop > li:nth-child(1) { animation-delay: 0.34s; }
		.gs-announce-dialog .gs-showcase__loop > li:nth-child(2) { animation-delay: 0.42s; }
		.gs-announce-dialog .gs-showcase__loop > li:nth-child(3) { animation-delay: 0.5s; }
		.gs-announce-dialog .gs-showcase__loop > li:nth-child(n + 4) { animation-delay: 0.58s; }
		.gs-announce-dialog .gs-cell:nth-child(1) { animation-delay: 0.5s; }
		.gs-announce-dialog .gs-cell:nth-child(2) { animation-delay: 0.56s; }
		.gs-announce-dialog .gs-cell:nth-child(3) { animation-delay: 0.62s; }
		.gs-announce-dialog .gs-cell:nth-child(4) { animation-delay: 0.68s; }
		.gs-announce-dialog .gs-cell:nth-child(n + 5) { animation-delay: 0.74s; }

		.gs-announce-dialog .gs-showcase__loop::before {
			animation: gs-showcase-draw 1.4s var(--gs-ease) 0.4s both;
		}
	}
}

@keyframes gs-showcase-in {
	from {
		opacity: 0;
		translate: 0 1.25rem;
	}
}

@keyframes gs-showcase-draw {
	from {
		scale: 0 1;
	}
}

/* No further than the stage's top padding, so no gap opens above the phone. */
@keyframes gs-showcase-drift {
	to {
		translate: 0 calc(-1 * var(--gs-cell-pad));
	}
}
