/*
 * Layout and effects theme.json cannot express: the starfield, header,
 * hero and buttons. social.css styles the icon links, footer.css the footer,
 * content.css the blocks inside pages.
 * Colours and type come from the theme.json presets so the editor matches.
 */

:root {
	--pm-night: var(--wp--preset--color--night);
	--pm-deep: var(--wp--preset--color--deep);
	--pm-dusk: var(--wp--preset--color--dusk);
	--pm-line: var(--wp--preset--color--line);
	--pm-text: var(--wp--preset--color--starlight);
	--pm-haze: var(--wp--preset--color--haze);
	--pm-violet: var(--wp--preset--color--violet);
	--pm-magenta: var(--wp--preset--color--magenta);
	--pm-aurora: var(--wp--preset--color--aurora);
	--pm-mono: var(--wp--preset--font-family--plex-mono);
	--pm-copper: var(--wp--preset--gradient--aurora);
	color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Scrolling to a section anchor must clear the sticky header, whose height
   nav.js publishes because it wraps to more rows on narrow screens. */
[id] {
	scroll-margin-top: calc(var(--pm-header-height, 4.25rem) + 0.75rem);
}

body {
	background-color: var(--pm-night);
	background-image:
		radial-gradient(1px 1px at 12% 18%, rgb(238 234 255 / 0.7), transparent 60%),
		radial-gradient(1px 1px at 68% 9%, rgb(238 234 255 / 0.5), transparent 60%),
		radial-gradient(1.5px 1.5px at 83% 31%, rgb(159 200 255 / 0.6), transparent 60%),
		radial-gradient(1px 1px at 37% 44%, rgb(238 234 255 / 0.4), transparent 60%),
		radial-gradient(1px 1px at 91% 72%, rgb(185 150 255 / 0.5), transparent 60%),
		radial-gradient(1px 1px at 6% 81%, rgb(238 234 255 / 0.4), transparent 60%),
		radial-gradient(1.5px 1.5px at 52% 63%, rgb(238 234 255 / 0.3), transparent 60%),
		radial-gradient(ellipse 80% 50% at 50% -10%, rgb(185 150 255 / 0.16), transparent 70%);
	background-size: 420px 420px, 380px 380px, 520px 520px, 300px 300px, 460px 460px, 340px 340px, 560px 560px, 100% 100%;
	background-attachment: fixed;
}

:where(a, button, summary, input):focus-visible {
	outline: 2px solid var(--pm-magenta);
	outline-offset: 3px;
}

::selection {
	background: var(--pm-violet);
	color: var(--pm-night);
}

.pm-dim {
	color: var(--pm-haze);
}
.pm-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgb(10 7 24 / 0.82);
	border-bottom: 1px solid rgb(58 48 112 / 0.6);
}

/* The blur sits on a layer behind the bar: a backdrop-filter on the header
   itself would trap the fixed full-screen menu inside the header's box. */
.pm-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	backdrop-filter: blur(10px);
}

.pm-header.is-overlay {
	background: linear-gradient(rgb(10 7 24 / 0.9), rgb(10 7 24 / 0.55));
}

.pm-header__bar {
	padding: 1rem var(--wp--style--root--padding-right) 1rem var(--wp--style--root--padding-left);
	gap: 0.75rem 2rem;
}

.pm-hero {
	position: relative;
	display: grid;
	box-sizing: border-box;
	/* The sticky header is about 4.2rem tall; the hero fills the rest of the
	   first screen so the pause button stays in view. */
	min-height: max(34rem, calc(100svh - 4.2rem));
	place-items: center;
	overflow: hidden;
	margin-block: 0;
	padding: var(--wp--preset--spacing--60) var(--wp--style--root--padding-right) var(--wp--preset--spacing--70);
	background:
		radial-gradient(ellipse 45% 55% at 38% 75%, rgb(185 150 255 / 0.28), transparent 70%),
		radial-gradient(ellipse 30% 40% at 22% 78%, rgb(125 242 193 / 0.14), transparent 70%),
		radial-gradient(ellipse 35% 45% at 62% 70%, rgb(255 112 216 / 0.14), transparent 70%),
		linear-gradient(180deg, transparent 55%, rgb(21 16 51 / 0.9) 100%);
	isolation: isolate;
}

.pm-hero__canvas {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	filter: blur(4px) saturate(1.3);
	opacity: 0;
	transition: opacity 1.2s ease;
}

.pm-hero.has-canvas .pm-hero__canvas {
	opacity: 1;
}

/* A darkened centre keeps the copy above 4.5:1 whatever the canvas draws. */
.pm-hero__inner {
	position: relative;
	max-width: 62rem;
	text-align: center;
}

.pm-hero__inner::before {
	content: "";
	position: absolute;
	inset: -3rem -4rem;
	z-index: -1;
	background: radial-gradient(closest-side, rgb(10 7 24 / 0.75), transparent);
}

.pm-hero__kicker {
	margin: 0 0 1.5rem;
	color: var(--pm-aurora);
	font-family: var(--pm-mono);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.pm-hero__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--display);
	font-weight: 200;
	letter-spacing: 0.22em;
	line-height: 1.05;
	text-shadow: 0 0 40px rgb(185 150 255 / 0.55);
	/* Wide tracking adds trailing space after the last letter; this re-centres it. */
	margin-right: -0.22em;
}

.pm-hero__title span {
	display: inline-block;
}

.pm-hero__lede {
	max-width: 36rem;
	margin: 1.75rem auto 0;
	color: var(--pm-haze);
	font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}

.pm-hero__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin-top: 2.5rem;
}

.pm-hero__toggle {
	position: absolute;
	right: clamp(1rem, 4vw, 2.5rem);
	bottom: 1.25rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--pm-haze);
	background: rgb(10 7 24 / 0.7);
	color: var(--pm-text);
	font-family: var(--pm-mono);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.pm-hero__toggle:hover {
	border-color: var(--pm-magenta);
}

.pm-btn,
.wp-block-button__link {
	display: inline-block;
	padding: 0.8rem 1.4rem;
	border: 1px solid var(--pm-violet);
	background: var(--pm-violet);
	color: var(--pm-night);
	font-family: var(--pm-mono);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pm-btn:hover,
.pm-btn:focus-visible,
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	border-color: var(--pm-magenta);
	background: var(--pm-magenta);
	color: var(--pm-night);
}

.pm-btn--ghost,
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: transparent;
	color: var(--pm-text);
}

.pm-btn--ghost:hover,
.pm-btn--ghost:focus-visible,
.wp-block-button.is-style-ghost .wp-block-button__link:hover,
.wp-block-button.is-style-ghost .wp-block-button__link:focus-visible {
	background: transparent;
	border-color: var(--pm-magenta);
	color: var(--pm-magenta);
}
.pm-page {
	padding-block: var(--wp--preset--spacing--60);
}

.pm-page__title {
	font-size: var(--wp--preset--font-size--x-large);
}
