/*
Theme Name: Bifrost Invaders
Theme URI: https://www.bifrostinvaders.com
Author: Gareth Hadfield
Author URI: https://www.bifrostinvaders.com
Description: Custom block theme for bifrostinvaders.com, built around the game's illuminated-manuscript art direction: ink outline, flat gouache colour, gold leaf on trim only. Design tokens live in theme.json; this file holds the theme header and only the styles that cannot be expressed through theme.json.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bifrostinvaders
Tags: block-patterns, block-styles, full-site-editing, one-column, wide-blocks, accessibility-ready
*/

/* Tokens */
:root {
	--bi-hairline: var(--wp--custom--hairline--gradient);
	--bi-hairline-color: var(--wp--custom--hairline--color);
}

/* Page Field */
body {
	background-image: radial-gradient(120rem 60rem at 50% -10%, rgba(27, 42, 74, 0.85) 0%, rgba(11, 16, 32, 0) 68%);
	background-repeat: no-repeat;
	background-attachment: fixed;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* Labels: Small Caps */
.is-style-manuscript-label,
.is-style-manuscript-title,
.wp-block-navigation .wp-block-navigation-item__label,
.wp-block-site-tagline,
.wp-block-post-date,
.wp-block-post-terms,
.wp-element-button,
.wp-block-button__link,
.wp-block-query-pagination {
	font-variant-caps: all-small-caps;
	text-transform: lowercase;
}

/* Focus Visibility */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* Masthead: the sky artwork behind a dark scrim */
.bi-header {
	background-color: var(--wp--preset--color--surface);
	background-image: linear-gradient(180deg, rgba(11, 16, 32, 0.55) 0%, rgba(11, 16, 32, 0.86) 62%, var(--wp--preset--color--base) 100%), url("assets/images/sky-background.jpg");
	background-size: 100% 100%, cover;
	background-position: center;
	background-repeat: no-repeat;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.bi-header__bar,
.bi-footer__inner {
	margin-left: auto;
	margin-right: auto;
	max-width: 78rem;
	width: 100%;
}

.bi-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .bi-header {
	top: 32px;
}

@media(max-width:782px) {
	.admin-bar .bi-header {
		top: 46px;
	}
}

#demo,
.bi-hero,
.bi-status,
.bi-gates,
.bi-cta,
#realms,
#letter,
#latest {
	scroll-margin-top: 7rem;
}

.bi-header__bar {
	align-items: center;
	column-gap: var(--wp--preset--spacing--40);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	row-gap: var(--wp--preset--spacing--30);
}

.bi-header__logo {
	display: block;
	grid-column: 2;
	justify-self: center;
	line-height: 0;
}

.bi-header__logo img {
	display: block;
	height: clamp(4.5rem, 7vw, 6rem);
	max-width: 100%;
	width: auto;
}

.bi-header__bar>* {
	margin-block-start: 0;
}

.bi-header__bar>.wp-block-navigation {
	grid-column: 3;
	justify-self: end;
}

.bi-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

@media(max-width:782px) {
	.bi-header__bar {
		column-gap: var(--wp--preset--spacing--20);
	}
}

/* Block Styles: Manuscript Label */
.wp-block-heading.is-style-manuscript-label {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.2em;
}

/* Block Styles: Manuscript Title */
.wp-block-heading.is-style-manuscript-title {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	letter-spacing: 0.16em;
}

/* Block Styles: Manuscript Panel */
.wp-block-group.is-style-manuscript-panel,
.wp-block-group.is-style-nordic-corners {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--bi-hairline-color);
	border-radius: 2px;
	padding: var(--wp--preset--spacing--50);
}

/* Block Styles: Nordic Corner Flourish */
.bi-nordic-corners,
.is-style-nordic-corners {
	--bi-corner-gold: var(--wp--preset--color--accent);
	--bi-corner-arm: 2.6rem;
	--bi-corner-inner-arm: 1.4rem;
	--bi-corner-step: 0.5rem;
	--bi-corner-stud: 4px;
	position: relative;
}

.bi-nordic-corners::before,
.bi-nordic-corners::after,
.is-style-nordic-corners::before,
.is-style-nordic-corners::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-repeat: no-repeat;
	filter: drop-shadow(0 0 3px rgba(201, 162, 39, 0.32));
}

.bi-nordic-corners::before,
.is-style-nordic-corners::before {
	background:
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left top / var(--bi-corner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left top / 1px var(--bi-corner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) var(--bi-corner-step) var(--bi-corner-step) / var(--bi-corner-inner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) var(--bi-corner-step) var(--bi-corner-step) / 1px var(--bi-corner-inner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) calc(var(--bi-corner-step) - 2px) calc(var(--bi-corner-step) - 2px) / var(--bi-corner-stud) var(--bi-corner-stud) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right bottom / var(--bi-corner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right bottom / 1px var(--bi-corner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right var(--bi-corner-step) bottom var(--bi-corner-step) / var(--bi-corner-inner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right var(--bi-corner-step) bottom var(--bi-corner-step) / 1px var(--bi-corner-inner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right calc(var(--bi-corner-step) - 2px) bottom calc(var(--bi-corner-step) - 2px) / var(--bi-corner-stud) var(--bi-corner-stud) no-repeat;
}

.bi-nordic-corners::after,
.is-style-nordic-corners::after {
	background:
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right top / var(--bi-corner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right top / 1px var(--bi-corner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right var(--bi-corner-step) top var(--bi-corner-step) / var(--bi-corner-inner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right var(--bi-corner-step) top var(--bi-corner-step) / 1px var(--bi-corner-inner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) right calc(var(--bi-corner-step) - 2px) top calc(var(--bi-corner-step) - 2px) / var(--bi-corner-stud) var(--bi-corner-stud) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left bottom / var(--bi-corner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left bottom / 1px var(--bi-corner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left var(--bi-corner-step) bottom var(--bi-corner-step) / var(--bi-corner-inner-arm) 1px no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left var(--bi-corner-step) bottom var(--bi-corner-step) / 1px var(--bi-corner-inner-arm) no-repeat,
		linear-gradient(var(--bi-corner-gold), var(--bi-corner-gold)) left calc(var(--bi-corner-step) - 2px) bottom calc(var(--bi-corner-step) - 2px) / var(--bi-corner-stud) var(--bi-corner-stud) no-repeat;
}

@media(max-width:560px) {

	.bi-nordic-corners,
	.is-style-nordic-corners {
		--bi-corner-arm: 1.8rem;
		--bi-corner-inner-arm: 1rem;
	}
}

/* Block Styles: Ghost Gold Button */
.wp-block-button.is-style-ghost-gold .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--accent);
	box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.8);
}

.wp-block-button.is-style-ghost-gold .wp-block-button__link:hover,
.wp-block-button.is-style-ghost-gold .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	box-shadow: none;
}

/* Block Styles: Lede */
p.is-style-lede {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	max-width: 42rem;
}

/* Block Styles: Gilded Frame */
.is-style-gilded-frame img {
	border: 1px solid var(--wp--preset--color--accent);
	box-shadow: var(--wp--custom--frame--inset), 0 0 0 7px rgba(201, 162, 39, 0.32), 0 30px 60px rgba(4, 6, 11, 0.65);
}

/* Gold Hairline Separator */
.wp-block-separator {
	background-color: transparent;
	background-image: var(--bi-hairline);
	border: 0;
	height: 1px;
	opacity: 1;
}

/* Hero Panel */
.bi-hero {
	align-items: center;
	background-image: linear-gradient(160deg, rgba(27, 42, 74, 0.95) 0%, rgba(20, 27, 46, 0.95) 58%, rgba(11, 16, 32, 0.98) 100%);
	border: 1px solid var(--bi-hairline-color);
	box-shadow: var(--wp--preset--shadow--lift);
	display: grid;
	gap: var(--wp--preset--spacing--50);
	grid-template-columns: minmax(0, 1fr) minmax(13rem, 21rem);
}

.bi-hero__title {
	font-size: var(--wp--preset--font-size--display);
	letter-spacing: -0.01em;
	line-height: 1.02;
	text-wrap: balance;
}

.bi-hero .wp-block-image {
	margin: 0;
}

.bi-hero .wp-block-image img {
	border: 1px solid var(--wp--preset--color--accent);
	box-shadow: var(--wp--custom--frame--inset), 0 0 0 7px rgba(201, 162, 39, 0.32), 0 30px 60px rgba(4, 6, 11, 0.65);
}

/*
	The key art is the way into the demo, so the link carries the whole frame
	and a large see-through play button sits over the middle of it.
*/
.bi-hero .wp-block-image a {
	display: block;
	position: relative;
}

.bi-hero .wp-block-image a::after {
	animation: bi-hero-play-glow 2.8s ease-in-out infinite;
	background-color: rgba(11, 16, 32, 0.5);
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: 50%;
	content: "";
	height: 5rem;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 5rem;
}

.bi-hero .wp-block-image a::before {
	border-bottom: 0.85rem solid transparent;
	border-left: 1.45rem solid var(--wp--preset--color--accent);
	border-top: 0.85rem solid transparent;
	content: "";
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-38%, -50%);
	z-index: 1;
}

.bi-hero .wp-block-image a:hover::after,
.bi-hero .wp-block-image a:focus-visible::after {
	background-color: rgba(201, 162, 39, 0.55);
}

@keyframes bi-hero-play-glow {

	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.45), 0 0 16px 2px rgba(201, 162, 39, 0.22);
	}

	50% {
		box-shadow: 0 0 0 0.65rem rgba(201, 162, 39, 0), 0 0 34px 0.85rem rgba(201, 162, 39, 0.6);
	}
}

@media(prefers-reduced-motion:reduce) {
	.bi-hero .wp-block-image a::after {
		animation: none;
	}
}

@media(max-width:781px) {
	.bi-hero {
		grid-template-columns: minmax(0, 1fr);
	}

	.bi-hero .wp-block-image {
		margin-left: auto;
		margin-right: auto;
		max-width: 17rem;
		order: -1;
	}
}

/* Realm Grid */
.realm-section {
	margin-left: auto;
	margin-right: auto;
	max-width: 60rem;
}

.realm-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The grid gap already spaces the cards, so drop the block gap core puts between them */
.realm-grid>.realm-card {
	margin-block-end: 0;
	margin-block-start: 0;
}

@media(max-width:781px) {
	.realm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media(max-width:560px) {
	.realm-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.realm-card {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.realm-card:hover {
	border-color: var(--bi-hairline-color);
	box-shadow: var(--wp--preset--shadow--lift);
	transform: translateY(-3px);
}

.realm-card .wp-block-image {
	margin: 0;
}

.realm-card .wp-block-image img {
	aspect-ratio: 9 / 16;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.realm-card__body {
	border-top: 1px solid var(--bi-hairline-color);
	padding: var(--wp--preset--spacing--30);
}

.realm-card__body p {
	margin: 0;
}

.realm-card h3 {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}

/* Realm Showcase */
.bi-realm {
	margin-left: auto;
	margin-right: auto;
	max-width: 60rem;
}

.bi-realm__title {
	font-size: var(--wp--preset--font-size--display);
	letter-spacing: -0.01em;
	line-height: 1.02;
	text-wrap: balance;
}

.bi-realm__status {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.16em;
	text-transform: lowercase;
}

.bi-realm__layout {
	align-items: start;
	display: grid;
	gap: var(--wp--preset--spacing--50);
	grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
	margin-top: var(--wp--preset--spacing--50);
}

@media(max-width:781px) {
	.bi-realm__layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The large panels keep the section rhythm at twice the standard block gap */
.bi-realm__artwork,
.bi-realm__guardian,
.bi-realm__layout,
.bi-realm__monsters {
	margin-top: calc(var(--wp--preset--spacing--40) * 4);
}

.bi-realm__art {
	margin: 0;
}

.bi-realm__art img {
	display: block;
	height: auto;
	width: 100%;
}

.bi-realm__art figcaption {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin-top: var(--wp--preset--spacing--20);
}

.bi-realm__notes {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

.bi-realm__monster-grid {
	align-items: stretch;
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-auto-rows: 1fr;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: var(--wp--preset--spacing--40);
}

@media(max-width:781px) {
	.bi-realm__monster-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media(max-width:560px) {
	.bi-realm__monster-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bi-realm__monster {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

/* A shared frame wider than the widest sprite lets every monster draw at the
   frame height, so all sprites share a height and a top edge. */
.bi-realm__monster .wp-block-image {
	align-items: center;
	aspect-ratio: 6 / 5;
	background-color: var(--wp--preset--color--base);
	display: flex;
	justify-content: center;
	margin: 0;
	overflow: hidden;
}

.bi-realm__monster .wp-block-image img {
	display: block;
	height: 100%;
	object-fit: contain;
	width: auto;
}

.bi-realm__monster-body {
	border-top: 1px solid var(--wp--preset--color--border);
	flex: 1;
	padding: var(--wp--preset--spacing--30);
}

.bi-realm__monster-body p {
	margin: 0;
}

.bi-realm__monster-body h3 {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}

/* The square frame is its own layer, so only the painted guardian moves inside it */
.bi-realm__guardian .wp-block-image {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin-left: auto;
	margin-right: auto;
	max-width: 28rem;
	overflow: hidden;
}

.bi-realm__guardian .wp-block-image::before {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	box-sizing: border-box;
	content: "";
	grid-column: 1;
	grid-row: 1;
}

.bi-realm__guardian img {
	animation: bi-guardian-wobble 6s ease-in-out infinite;
	box-sizing: border-box;
	display: block;
	grid-column: 1;
	grid-row: 1;
	height: auto;
	padding: 2.5%;
	transform-origin: 50% 90%;
	width: 100%;
}

/* The pivot sits below the sprite's centre so the sway reads as a trunk straining from its root rather than a spin */
@keyframes bi-guardian-wobble {

	0%,
	100% {
		transform: rotate(-1.6deg);
	}

	50% {
		transform: rotate(1.6deg);
	}
}

@media(prefers-reduced-motion:reduce) {
	.bi-realm__guardian img {
		animation: none;
	}
}

.bi-realm__artwork img {
	border: 1px solid var(--wp--preset--color--border);
	display: block;
	height: auto;
	width: 100%;
}

.bi-realm__nav {
	border-top: 1px solid var(--wp--preset--color--border);
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--30);
}

.bi-realm__nav-link {
	margin: 0;
}

.bi-realm__list {
	column-gap: var(--wp--preset--spacing--50);
	columns: 2;
}

@media(max-width:560px) {
	.bi-realm__list {
		columns: 1;
	}
}

/* Article Body */
.bi-article .wp-block-post-content>p:first-of-type::first-letter {
	color: var(--wp--preset--color--accent);
	float: left;
	font-family: var(--wp--preset--font-family--display);
	font-size: 3.4em;
	line-height: 0.82;
	padding-right: 0.08em;
}

.bi-article .wp-block-post-featured-image img {
	border: 1px solid var(--wp--preset--color--border);
}

/* Footer */
.bi-footer {
	border-top: 1px solid var(--wp--preset--color--border);
}

.bi-footer__brand {
	row-gap: var(--wp--preset--spacing--20);
}

.bi-footer__mark {
	background-image: url("assets/images/vessel-mark.png");
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	flex: 0 0 auto;
	height: 2.75rem;
	width: 2.75rem;
}

/* Forms */
input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	padding: 0.55em 0.75em;
}

input:not([type="submit"]):not([type="button"]):focus,
textarea:focus,
select:focus {
	border-color: var(--wp--preset--color--accent);
}

/* Tables */
table {
	border-collapse: collapse;
}

th,
td {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 0.6em 0.8em;
	text-align: left;
}

th {
	color: var(--wp--preset--color--accent);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.12em;
	text-transform: lowercase;
}

/* Motion */
@media(prefers-reduced-motion:reduce) {
	.realm-card {
		transition: none;
	}

	.realm-card:hover {
		transform: none;
	}
}

/* Demo Island */
.bi-demo__layout {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 22rem);
	margin-top: var(--wp--preset--spacing--40);
}

.bi-demo__side {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.bi-demo__side .bi-demo__start,
.bi-demo__side .bi-demo__controls,
.bi-demo__side .bi-demo__about {
	margin-top: 0;
}

@media(max-width:900px) {
	.bi-demo__layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bi-demo__stage {
	background-color: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 2px;
	box-shadow: var(--wp--preset--shadow--lift);
	padding: var(--wp--preset--spacing--40);
}

.bi-demo__screen {
	margin-left: auto;
	margin-right: auto;
	max-width: min(26rem, 40vh);
	position: relative;
}

.bi-demo__playfield {
	aspect-ratio: 9/16;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	display: block;
	height: auto;
	touch-action: none;
	width: 100%;
	-webkit-user-select: none;
	user-select: none;
}

.bi-demo__fallback {
	color: var(--wp--preset--color--contrast);
	padding: var(--wp--preset--spacing--30);
}

.bi-demo__start {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--40);
}

.bi-demo__start p {
	margin: 0;
}

.bi-demo__controls-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

.bi-demo__play,
.bi-demo__sound {
	border-radius: 2px;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
	padding: 0.7em 1.4em;
	text-transform: lowercase;
}

.bi-demo__play {
	background-color: var(--wp--preset--color--accent);
	border: 1px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-weight: 600;
}

.bi-demo__play:hover,
.bi-demo__play:focus-visible {
	background-color: var(--wp--preset--color--accent-hover);
	border-color: var(--wp--preset--color--accent-hover);
}

.bi-demo__sound {
	background-color: transparent;
	border: 1px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.bi-demo__sound:hover,
.bi-demo__sound:focus-visible {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/*
	The full-screen control is a real button wearing the ghost-gold wrapper, so the
	browser's own button edge is cleared and the wrapper's colours are left alone.
*/
.bi-demo__fullscreen {
	border: 0;
	font-family: inherit;
}

/* The band fills the screen, so its way out rides inside it and shows only there */
.bi-demo__exit-fullscreen {
	display: none;
}

.bi-demo__stage:fullscreen .bi-demo__exit-fullscreen,
.bi-demo__stage:-webkit-full-screen .bi-demo__exit-fullscreen,
.bi-demo__stage--filled .bi-demo__exit-fullscreen {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 2px;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
	/* The group's block gap would otherwise push the fixed button down from its top */
	margin: 0;
	padding: 0.7em 1.4em;
	position: fixed;
	right: var(--wp--preset--spacing--30);
	top: var(--wp--preset--spacing--30);
	z-index: 10;
}

/*
	The band fills the screen itself, with a strip along the top for the way out and
	the playfield as tall as the screen allows below it, so the way out never sits
	over the field.
*/
.bi-demo__stage:fullscreen,
.bi-demo__stage:-webkit-full-screen,
.bi-demo__stage--filled {
	--bi-demo-exit-band: calc(max(var(--wp--preset--spacing--30), env(safe-area-inset-top, 0px)) + 2.9rem + var(--wp--preset--spacing--30));
	align-items: center;
	border: 0;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	padding: var(--bi-demo-exit-band) 0 0;
}

.bi-demo__stage:fullscreen .bi-demo__playfield,
.bi-demo__stage:-webkit-full-screen .bi-demo__playfield,
.bi-demo__stage--filled .bi-demo__playfield {
	max-height: calc(100vh - var(--bi-demo-exit-band));
	width: auto;
}

/*
	Where the browser cannot hand the band the screen (iPhone Safari), the band covers the
	window itself; the dynamic height follows the address bar as it folds away.
*/
.bi-demo__stage--filled {
	height: 100vh;
	height: 100dvh;
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 200;
}

.bi-demo__stage--filled .bi-demo__screen {
	max-width: 100vw;
}

.bi-demo__stage--filled .bi-demo__playfield {
	max-height: calc(100dvh - var(--bi-demo-exit-band));
	max-width: 100vw;
}

/* The way out clears the notch and the rounded corner the band now runs under */
.bi-demo__stage--filled .bi-demo__exit-fullscreen {
	right: max(var(--wp--preset--spacing--30), env(safe-area-inset-right));
	top: max(var(--wp--preset--spacing--30), env(safe-area-inset-top));
}

/* The page behind the band must not move under a thumb reaching for the playfield */
.bi-demo--full-screen {
	overflow: hidden;
	overscroll-behavior: none;
}

.bi-demo__controls {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	margin-top: var(--wp--preset--spacing--50);
}

.bi-demo__item {
	border-top: 1px solid var(--bi-hairline-color);
	padding-top: var(--wp--preset--spacing--30);
}

.bi-demo__item p {
	margin: 0;
}

/*
	The way out is plain markup inside an HTML block, so the buttons block's own
	flex layout never loads; the theme lays the control out itself.
*/
.bi-demo__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

/* Status Strip */
.bi-status__cards {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bi-status__updated {
	margin-top: var(--wp--preset--spacing--20);
}

.bi-status__cards>.bi-status__card {
	margin-block: 0;
}

.bi-status__card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.bi-status__card p {
	margin: 0;
}

@media(max-width:781px) {
	.bi-status__cards {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The Gates */
.bi-gates__tiers {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Core gives every flow child a top margin but the first, which would shorten
   the second and third panels against the first; the grid gap is the spacing */
.bi-gates__tiers>.bi-gates__tier {
	margin-block: 0;
}

.bi-gates__tier {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.bi-gates__tier p {
	margin: 0;
}

.bi-gates__score-list {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	margin-top: var(--wp--preset--spacing--40);
	padding-left: var(--wp--preset--spacing--40);
}

.bi-gates__score-list li {
	border-top: 1px solid var(--bi-hairline-color);
	padding-top: var(--wp--preset--spacing--20);
}

@media(max-width:781px) {
	.bi-gates__tiers {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Dispatch: the question band */
.wp-block-group.bi-question {
	margin-top: var(--wp--preset--spacing--60);
}

.bi-question__link {
	color: var(--wp--preset--color--accent);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.12em;
	text-decoration: underline;
	text-underline-offset: 0.3em;
	text-transform: lowercase;
}

.bi-question__link:hover,
.bi-question__link:focus-visible {
	color: var(--wp--preset--color--accent-hover);
}

.bi-question__note {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Realm Card States */
.realm-card--open {
	border-color: var(--wp--preset--color--accent);
}

.realm-card--open .wp-block-image img {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: -2px;
}

.realm-card--sealed {
	border-style: dashed;
}

.realm-card--sealed .wp-block-image img {
	filter: grayscale(1) contrast(0.62) brightness(0.85);
}

/* Letter */
.bi-letter__row {
	align-items: end;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--40);
}

.bi-letter__row label {
	color: var(--wp--preset--color--contrast);
	flex: 1 1 100%;
	font-variant-caps: all-small-caps;
	letter-spacing: 0.12em;
	text-transform: lowercase;
}

.bi-letter__row input {
	flex: 1 1 14rem;
}

.bi-letter__submit {
	background-color: var(--wp--preset--color--accent);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 2px;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	font-family: inherit;
	font-variant-caps: all-small-caps;
	font-weight: 600;
	padding: 0.6em 1.2em;
	text-transform: lowercase;
}

.bi-letter__submit:hover,
.bi-letter__submit:focus-visible {
	background-color: var(--wp--preset--color--accent-hover);
	border-color: var(--wp--preset--color--accent-hover);
}

.bi-letter__notices {
	margin-top: var(--wp--preset--spacing--30);
}

.bi-letter__notice--ok {
	color: var(--wp--preset--color--accent);
}

.bi-letter__notice--error {
	color: var(--wp--preset--color--ember);
}

/* Letter: Ninja Forms */
.bi-letter .nf-form-cont {
	margin-top: var(--wp--preset--spacing--40);
}

.bi-letter .nf-field-container {
	margin-bottom: var(--wp--preset--spacing--30);
}

.bi-letter .nf-field-label label {
	color: var(--wp--preset--color--contrast);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.12em;
	text-transform: lowercase;
}

.bi-letter .nf-field-container.checkbox-container .nf-field-label {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	text-transform: none;
}

.bi-letter .nf-field-element input[type="email"],
.bi-letter .nf-field-element input[type="text"] {
	font-size: var(--wp--preset--font-size--medium);
	padding: 0.7em 0.85em;
	width: 100%;
}

.bi-letter .nf-field-element input[type="submit"] {
	background-color: var(--wp--preset--color--accent);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 2px;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	font-family: inherit;
	font-variant-caps: all-small-caps;
	font-weight: 600;
	padding: 0.6em 1.2em;
	text-transform: lowercase;
}

.bi-letter .nf-field-element input[type="submit"]:hover,
.bi-letter .nf-field-element input[type="submit"]:focus-visible {
	background-color: var(--wp--preset--color--accent-hover);
	border-color: var(--wp--preset--color--accent-hover);
}

.bi-letter .nf-error-msg {
	color: var(--wp--preset--color--ember);
}

.bi-letter .nf-response-msg {
	color: var(--wp--preset--color--accent);
	margin-top: var(--wp--preset--spacing--30);
}

/* The question */
.bi-poll {
	margin-bottom: var(--wp--preset--spacing--30);
}

.bi-poll__fieldset {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.bi-poll__legend {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: var(--wp--preset--spacing--20);
	padding: 0;
}

.bi-poll__answers {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.bi-poll__answer-button {
	background-color: transparent;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 2px;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
	font-family: inherit;
	font-variant-caps: all-small-caps;
	font-weight: 600;
	letter-spacing: 0.12em;
	padding: 0.6em 1.2em;
	text-transform: lowercase;
}

.bi-poll__answer-button:hover,
.bi-poll__answer-button:focus-visible {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.bi-poll__summary {
	color: var(--wp--preset--color--contrast);
	margin-bottom: var(--wp--preset--spacing--20);
}

.bi-poll__tallies {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bi-poll__tally {
	margin-bottom: var(--wp--preset--spacing--20);
}

.bi-poll__tally-line {
	color: var(--wp--preset--color--contrast);
	display: block;
	font-size: var(--wp--preset--font-size--small);
}

.bi-poll__bar {
	background-color: var(--wp--preset--color--border);
	display: block;
	height: 4px;
	margin-top: var(--wp--preset--spacing--20);
	overflow: hidden;
}

.bi-poll__bar-fill {
	background-color: var(--wp--preset--color--accent);
	display: block;
	height: 100%;
	width: var(--bi-poll-share, 0%);
}

.bi-poll__notices {
	margin-top: var(--wp--preset--spacing--20);
}

.bi-poll__notice--ok {
	color: var(--wp--preset--color--accent);
}

.bi-poll__notice--error {
	color: var(--wp--preset--color--ember);
}

/* Floating Scroll Hint */
.bi-scroll-hint {
	align-items: center;
	background-color: rgba(11, 16, 32, 0.92);
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 999px;
	bottom: calc(var(--wp--preset--spacing--40) + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 18px 48px rgba(4, 6, 11, 0.55);
	color: var(--wp--preset--color--accent);
	column-gap: var(--wp--preset--spacing--20);
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-variant-caps: all-small-caps;
	font-weight: 600;
	left: 50%;
	letter-spacing: 0.14em;
	padding: 0.55em 1.1em;
	position: fixed;
	text-transform: lowercase;
	transform: translateX(-50%);
	transition: background-color 160ms ease, color 160ms ease;
	z-index: 90;
}

.bi-scroll-hint[hidden] {
	display: none;
}

.bi-scroll-hint:hover,
.bi-scroll-hint:focus-visible {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.bi-scroll-hint__chevron {
	animation: bi-scroll-hint-bob 2.4s ease-in-out infinite;
	height: 1rem;
	width: 1rem;
}

@keyframes bi-scroll-hint-bob {

	0%,
	100% {
		transform: translateY(-2px);
	}

	50% {
		transform: translateY(3px);
	}
}

@media(prefers-reduced-motion:reduce) {
	.bi-scroll-hint__chevron {
		animation: none;
	}
}