/* Gadget theme: aged copper on a teal slate wall, lit from above. */

:root {
	--gx-void: var(--wp--preset--color--void, #030505);
	--gx-slate: var(--wp--preset--color--slate, #12292b);
	--gx-slate-deep: var(--wp--preset--color--slate-deep, #071416);
	--gx-copper: #b8862a; /* accents are gold now; the copper stays in the film */
	--gx-glint: #f6d980;
	--gx-dust: var(--wp--preset--color--dust, #93a9ab);
	--gx-bone: var(--wp--preset--color--bone, #e6dccd);
	--gx-metal: linear-gradient(172deg, #f6c99c 0%, #c27a46 34%, #5c2c15 54%, #d99a66 74%, #7d3e1e 100%);
	--gx-gold: linear-gradient(176deg, #fff3c4 0%, #f2cf6b 30%, #b8862a 52%, #f6d980 74%, #a8771f 100%);
	--gx-ease:cubic-bezier(0.65, 0, 0.35, 1);
}

::selection { background: var(--gx-copper); color: var(--gx-void); }

/* ---------- The wall (every page except the front page) ---------- */

body:not(.home) {
	min-height: 100vh;
	background-color: var(--gx-slate-deep);
	background-image:
		radial-gradient(ellipse 55% 62% at 50% -6%, rgba(132, 186, 178, 0.30), rgba(70, 120, 118, 0.10) 55%, transparent 78%),
		radial-gradient(ellipse 120% 90% at 50% 40%, transparent 40%, rgba(1, 3, 3, 0.85) 100%),
		var(--gx-cracks, none),
		linear-gradient(var(--gx-slate), var(--gx-slate-deep) 70%);
	background-size: auto, auto, 512px 384px, auto;
	background-blend-mode: normal, normal, overlay, normal;
	background-attachment: fixed, fixed, scroll, fixed;
}

body:not(.home) .wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
body:not(.home) .gx-main { flex: 1 0 auto; }

/* Dust motes (assets/js/motes.js): drift in front of the wall, never catch clicks. */
.gx-motes {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: -1; /* above the wall (the page background), behind text and screenshots */
}

/* ---------- Header ---------- */

.gx-header-wrap {
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
	position: relative;
	z-index: 20;
}

.gx-header { align-items: center; gap: 1.5rem; }

.gx-home {
	display: inline-flex;
	align-items: center;
	gap: 0.85rem;
	color: var(--gx-bone);
	text-decoration: none;
}
.gx-home:hover { color: var(--gx-glint); }
.gx-home:focus-visible { outline: 2px solid var(--gx-glint); outline-offset: 6px; }

/* Header wordmark: GADGET over Productions, both in polished gold. */
.gx-home__name {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1;
	white-space: nowrap;
	filter: drop-shadow(0 1px 0 rgba(40, 24, 2, 0.9));
}
.gx-home__name b,
.gx-home__name span {
	background: var(--gx-gold);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.gx-home__name b {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 900;
	font-size: 1.3rem;
	letter-spacing: -0.02em;
}
.gx-home__name span {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	font-size: 0.98rem;
	letter-spacing: 0.035em;
	margin-top: 0.2em;
}
.gx-home:hover .gx-home__name { filter: drop-shadow(0 1px 0 rgba(40, 24, 2, 0.9)) brightness(1.18); }

/* The mark, and its one glint run on page load */

.gx-mark { display: block; width: 2.6rem; height: auto; overflow: visible; }

.gx-mark__glint {
	fill: none;
	stroke: #fff4cf;
	stroke-width: 14;
	stroke-linecap: round;
	stroke-dasharray: 16 84;
	stroke-dashoffset: 100;
	opacity: 0;
	filter: drop-shadow(0 0 18px rgba(255, 210, 110, 0.95));
	animation: gx-trace 2.6s var(--gx-ease) 0.35s 1 forwards;
}
.gx-mark__glint--1 { animation-delay: 0.5s; }

@keyframes gx-trace {
	0% { stroke-dashoffset: 100; opacity: 0; }
	12% { opacity: 1; }
	80% { opacity: 1; }
	100% { stroke-dashoffset: -16; opacity: 0; }
}

/* Navigation */

/* Doubled class to out-rank core's `.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content`. */
.gx-header .gx-nav .wp-block-navigation-item__content.wp-block-navigation-item__content {
	position: relative;
	text-decoration: none;
	color: var(--gx-bone);
	transition: color 0.2s;
}
.gx-header .gx-nav .wp-block-navigation-item__content.wp-block-navigation-item__content:hover { color: #f6d980; }

/* The page you're on: gold, with a thin glint line beneath. */
.gx-header .gx-nav .current-menu-item > .wp-block-navigation-item__content.wp-block-navigation-item__content,
.gx-header .gx-nav .wp-block-navigation-item__content.wp-block-navigation-item__content[aria-current="page"] {
	color: #f2cf6b;
}
.gx-header .gx-nav .current-menu-item > .wp-block-navigation-item__content::after,
.gx-header .gx-nav .wp-block-navigation-item__content[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: -0.15em;
	right: -0.15em;
	bottom: -0.5em;
	height: 1px;
	background: linear-gradient(90deg, transparent, #f6d980 25%, #fff3c4 50%, #f6d980 75%, transparent);
	box-shadow: 0 0 6px rgba(246, 217, 128, 0.6);
}
.gx-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--gx-slate-deep) !important;
	color: var(--gx-bone) !important;
}
.gx-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	font-size: 1.5rem;
}

/* ---------- Page content ---------- */

.gx-main {
	padding-top: clamp(2.5rem, 9vh, 6rem);
	padding-bottom: clamp(3rem, 10vh, 7rem);
}

/* Titles are cast in the same gold as the header logo, standing slightly proud of the wall. */
.gx-title {
	background: var(--gx-gold);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	filter: drop-shadow(0 0.04em 0 #2a1a02) drop-shadow(0 0.18em 0.25em rgba(0, 0, 0, 0.55));
	text-wrap: balance;
	margin-bottom: 0.4em;
}

.gx-main p,
.gx-main li { max-width: 66ch; text-wrap: pretty; }
.gx-main p { color: var(--gx-bone); }
/* Directly inside the page column, keep text on the same edges as the title and buttons. */
.gx-main.is-layout-constrained > p { max-width: var(--wp--style--global--content-size, 680px); }

.gx-main h2,
.gx-main h3 { margin-top: 2.2em; }

.gx-main hr,
.wp-block-separator {
	border: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gx-copper) 20%, var(--gx-glint) 50%, var(--gx-copper) 80%, transparent);
	opacity: 0.7;
}

.gx-main a:not(.wp-element-button) {
	text-decoration-color: rgba(242, 207, 107, 0.55);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.gx-main a:not(.wp-element-button):hover { text-decoration-color: var(--gx-glint); }

.gx-main :where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--gx-glint);
	outline-offset: 3px;
}

.gx-feature img,
.gx-main .wp-block-image img,
.gx-main .wp-block-video video {
	border-radius: 2px;
	box-shadow: 0 1.2rem 2.5rem -0.8rem rgba(0, 0, 0, 0.7);
}

.gx-main .wp-block-post-date { letter-spacing: 0.03em; }

.gx-list > li { padding-block: 1.6rem; border-bottom: 1px solid rgba(147, 169, 171, 0.18); }
.gx-list .wp-block-post-title a { text-decoration: none; color: var(--gx-bone); }
.gx-list .wp-block-post-title a:hover { color: var(--gx-glint); }

.gx-main input:not([type="submit"]),
.gx-main textarea,
.gx-main select {
	background: rgba(3, 5, 5, 0.55);
	border: 1px solid rgba(147, 169, 171, 0.35);
	color: var(--gx-bone);
	padding: 0.6em 0.8em;
	font: inherit;
	border-radius: 2px;
}

/* ---------- Product pages (apps) ---------- */

/* Opening line under the title. */
.gx-main .gx-lede {
	font-size: clamp(1.35rem, 2.2vw, 1.7rem);
	font-weight: 300;
	line-height: 1.35;
	color: var(--gx-bone);
	max-width: 32ch;
	text-wrap: balance;
	margin-top: 0;
}

/* Screenshots hang on the wall: deep shadow, a faint warm rim where the spotlight catches them. */
.gx-main .gx-shot img {
	border-radius: 8px;
	box-shadow:
		0 0 0 1px rgba(246, 217, 128, 0.14),
		0 1.6rem 3rem -0.6rem rgba(0, 0, 0, 0.75),
		0 0.4rem 1rem rgba(0, 0, 0, 0.45);
}
.gx-main .gx-shot { margin: 0; }
.gx-main .gx-shot figcaption {
	margin-top: 0.9rem;
	text-align: left;
	color: var(--gx-dust);
	font-size: 0.95rem;
}

/* A feature: screenshot beside its text, vertically centred. */
.gx-main .gx-feature-row {
	align-items: center !important;
	gap: clamp(1.75rem, 5vw, 4.5rem) !important;
	margin-block: clamp(3rem, 9vh, 6rem) !important;
}
.gx-main .gx-feature-row h2 { margin-top: 0; }
.gx-main .gx-feature-row .wp-block-column > h2:not(:first-child) { margin-top: 2.2em; }

/* The opening row sits straight under the title, top-aligned. */
.gx-main .wp-block-post-content > .gx-feature-row:first-child,
.gx-main .gx-title + .gx-feature-row {
	margin-top: 0.5rem !important;
	align-items: flex-start !important;
}

/* Sections without a screenshot: a short gold rule over the heading ties them to the title. */
.gx-main .gx-section {
	margin-top: clamp(3rem, 9vh, 6rem) !important;
	padding-top: 1.6rem;
	background: linear-gradient(90deg, #f2cf6b, rgba(242, 207, 107, 0)) top left / 4rem 1px no-repeat;
}
.gx-main .gx-section > h2 { margin-top: 0; }

/* Shortcut keys */
.gx-main kbd {
	font: 500 0.85em/1 var(--wp--preset--font-family--body);
	padding: 0.3em 0.45em 0.15em;
	border: 1px solid rgba(230, 220, 205, 0.3);
	border-bottom-width: 2px;
	border-radius: 3px;
	background: rgba(3, 5, 5, 0.4);
	white-space: nowrap;
}

/* Lists on product pages: gold dash markers instead of bullets. */
.gx-main .gx-points {
	list-style: none;
	padding-left: 0;
}
.gx-main .gx-points li {
	position: relative;
	padding-left: 1.4rem;
	margin-bottom: 0.7rem;
}
.gx-main .gx-points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.72em;
	width: 0.7rem;
	height: 1px;
	background: #f2cf6b;
}
.gx-main .gx-points strong { color: #f2cf6b; font-weight: 600; }

/* Plain facts at the end of a page. */
.gx-main .gx-specs { color: var(--gx-dust); font-size: 0.95rem; }

/* The floating widget, cut out so it sits on the wall the way it sits on a desktop. */
.gx-main .gx-widget { margin: 0; }
.gx-main .gx-widget img { box-shadow: none; border-radius: 0; filter: drop-shadow(0 0.5rem 1.2rem rgba(0, 0, 0, 0.55)); }
.gx-main .gx-widget figcaption { margin-top: 0.4rem; text-align: center; color: var(--gx-dust); font-size: 0.95rem; }
.gx-main .gx-feature-row.gx-section { align-items: flex-start !important; }

@media (max-width: 781px) {
	/* On phones, text first, then its screenshot, whichever side it sat on. */
	.gx-main .gx-feature-row.is-shot-left > .wp-block-column:first-child { order: 2; }
}

/* ---------- Footer ---------- */

.gx-footer {
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
	color: var(--gx-dust);
	border-top: 1px solid rgba(147, 169, 171, 0.14);
}
.gx-footer p { margin: 0; }
.gx-footer__links { column-gap: 1.75rem !important; }
.gx-footer a { color: var(--gx-dust); text-decoration-color: rgba(147, 169, 171, 0.4); text-underline-offset: 0.2em; }
.gx-footer a:hover { color: #f6d980; text-decoration-color: currentColor; }

/* ---------- Front page: the film stage ---------- */

body.home { background: #000; overflow-x: hidden; }

.home .gx-header-slot {
	position: absolute;
	inset: var(--wp-admin--admin-bar--height, 0px) 0 auto 0; /* clear the admin bar when logged in */
	z-index: 20;
	transition: opacity 1.4s ease 0.4s;
}
.home .gx-header-slot .gx-header-wrap { background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.gx-js .home:not(.gx-landed) .gx-header-slot { opacity: 0; }
.home .gx-home { visibility: hidden; } /* the logo and name are already on the wall */

.gx-front { position: relative; margin: 0 !important; padding: 0 !important; max-width: none !important; }

.gx-stage {
	position: relative;
	height: 100vh;
	height: 100svh;
	min-height: 22rem;
	overflow: hidden;
	background: #000;
}

.gx-stage__still,
.gx-stage__film {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 45%;
	max-width: none;
}

/* Portrait screens: crop in on the centre of the frame (logo and wordmark still fit)
   and let its top and bottom edges fade into the dark. */
@media (max-aspect-ratio: 4/5) {
	.gx-stage__still,
	.gx-stage__film {
		width: 235vw;
		height: auto;
		aspect-ratio: 16 / 9;
		left: 50%;
		top: 46%;
		inset-inline-end: auto;
		bottom: auto;
		transform: translate(-50%, -50%);
		object-fit: cover;
		-webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
		mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
	}
	.gx-stage { background: radial-gradient(ellipse 120% 45% at 50% 40%, #0b1c1e, #000 72%); }
}

/* Without script the wall simply shows. With script (html.gx-js), the film plays first. */
.gx-stage__still { opacity: 1; transition: opacity 2.2s ease; }
.gx-stage__film { opacity: 0; pointer-events: none; transition: opacity 1.4s ease; }

.gx-js .gx-stage:not([data-state="landed"]) .gx-stage__still { opacity: 0; }
.gx-js .gx-stage[data-state="playing"] .gx-stage__film { opacity: 1; }

.gx-stage__controls {
	position: absolute;
	right: clamp(1rem, 3vw, 2.5rem);
	bottom: clamp(1rem, 3vw, 2rem);
	z-index: 5;
	display: flex;
	gap: 0.5rem;
}

.gx-ctl {
	font: 500 0.85rem/1 var(--wp--preset--font-family--body);
	letter-spacing: 0.04em;
	color: var(--gx-bone);
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(230, 220, 205, 0.28);
	border-radius: 2px;
	padding: 0.75em 1.05em 0.6em;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, background-color 0.2s;
	backdrop-filter: blur(4px);
}
.gx-ctl:hover { color: var(--gx-glint); border-color: var(--gx-copper); }
.gx-ctl:focus-visible { outline: 2px solid var(--gx-glint); outline-offset: 3px; }
.gx-ctl[aria-pressed="true"] { color: var(--gx-glint); border-color: var(--gx-copper); }

/* Which controls show in each state */
.gx-ctl[data-gx="replay"] { display: none; }
.gx-stage[data-state="landed"] .gx-ctl[data-gx="replay"] { display: inline-block; }
.gx-stage[data-state="landed"] .gx-ctl[data-gx="skip"],
.gx-stage[data-state="landed"] .gx-ctl[data-gx="sound"] { display: none; }
.gx-stage[data-state="loading"] .gx-stage__controls { visibility: hidden; }

/* What we make, bottom left of the wall. */
.gx-front__about {
	position: absolute;
	left: clamp(1rem, 3vw, 2.5rem);
	bottom: clamp(1rem, 3vw, 2rem);
	z-index: 4;
	max-width: 24rem;
	transition: opacity 1.6s ease 1.2s, transform 1.6s ease 1.2s;
}
.gx-js .home:not(.gx-landed) .gx-front__about { opacity: 0; transform: translateY(0.4rem); pointer-events: none; }
.gx-front__about p {
	margin: 0 0 0.6rem;
	font-weight: 300;
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	letter-spacing: 0.03em;
	line-height: 1.35;
	color: var(--gx-bone);
}
.gx-front__apps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gx-front__apps a {
	display: block;
	padding: 0.7em 1.05em 0.55em;
	border: 1px solid rgba(242, 207, 107, 0.5);
	border-radius: 2px;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	color: #f6d980;
	text-decoration: none;
	font-size: 0.95rem;
	line-height: 1.2;
	transition: background-color 0.2s, color 0.2s;
}
.gx-front__apps a b { font-family: var(--wp--preset--font-family--display); font-weight: 800; letter-spacing: -0.01em; margin-right: 0.35em; }
.gx-front__apps a span { color: var(--gx-bone); font-weight: 300; }
.gx-front__apps a:hover { background: #f2cf6b; color: var(--gx-void); }
.gx-front__apps a:hover span { color: var(--gx-void); }
.gx-front__apps a:focus-visible { outline: 2px solid #f6d980; outline-offset: 3px; }

@media (max-width: 700px) {
	.gx-stage__controls { left: 1rem; right: 1rem; justify-content: center; }
	.gx-front__about { left: 1rem; right: 1rem; bottom: 4.6rem; max-width: none; text-align: center; }
	.gx-front__apps { justify-content: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.gx-mark__glint { animation: none; opacity: 0; }
	.gx-stage__still,
	.gx-stage__film,
	.gx-front__line,
	.home .gx-header-slot { transition: none; }
}
