/* ==========================================================================
   Nebula — front-end styles
   Sections
   01. Base & tokens
   02. Ambient backdrop (canvas, grid, aurora, noise)
   03. Preloader
   04. Reading progress
   05. Header & navigation
   06. Buttons & links
   07. Block styles (glass, tilt, gradient text, checklist…)
   08. Scroll reveal
   09. Marquee
   10. Hero
   11. Cards, stats & post grid
   12. Single post & page content
   13. Footer
   14. Utilities, a11y & reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Base & tokens
   -------------------------------------------------------------------------- */

:root {
	--nebula-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--nebula-header-height: 76px;
	--nebula-ring: 0 0 0 2px var(--wp--preset--color--base), 0 0 0 4px var(--wp--preset--color--accent);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--nebula-header-height) + 1.5rem);
	-webkit-text-size-adjust: 100%;
}

body.nebula {
	background-color: var(--wp--preset--color--base);
	overflow-x: hidden;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Keep every layout layer above the fixed backdrop. */
.wp-site-blocks {
	position: relative;
	z-index: 1;
}

::selection {
	background: rgba(56, 182, 255, 0.28);
	color: var(--wp--preset--color--white);
}

img,
video,
canvas,
svg {
	max-width: 100%;
	height: auto;
}

hr.wp-block-separator {
	opacity: 1;
}

/* --------------------------------------------------------------------------
   02. Ambient backdrop
   -------------------------------------------------------------------------- */

.nebula-backdrop {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	background:
		radial-gradient(90% 70% at 50% -10%, #0b1424 0%, rgba(11, 20, 36, 0) 60%),
		var(--wp--preset--color--base);
}

.nebula-backdrop__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	opacity: 0.85;
}

/* Perspective grid that fades into the horizon. */
.nebula-backdrop__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(56, 182, 255, 0.075) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(56, 182, 255, 0.075) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 78%);
	-webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 78%);
	animation: nebula-grid-drift 24s linear infinite;
}

@keyframes nebula-grid-drift {
	from { background-position: 0 0, 0 0; }
	to   { background-position: 64px 64px, 64px 64px; }
}

/* Slow moving aurora blobs. */
.nebula-backdrop__aurora {
	position: absolute;
	inset: -30%;
	background:
		radial-gradient(38% 34% at 18% 22%, rgba(56, 182, 255, 0.28) 0%, transparent 70%),
		radial-gradient(32% 30% at 82% 30%, rgba(139, 123, 255, 0.24) 0%, transparent 70%),
		radial-gradient(40% 36% at 55% 88%, rgba(34, 211, 238, 0.16) 0%, transparent 72%);
	filter: blur(38px);
	animation: nebula-aurora 26s ease-in-out infinite alternate;
	will-change: transform;
}

@keyframes nebula-aurora {
	0%   { transform: translate3d(-3%, -2%, 0) scale(1); }
	50%  { transform: translate3d(3%, 2%, 0) scale(1.08); }
	100% { transform: translate3d(-2%, 3%, 0) scale(1.02); }
}

/* Very light film grain to kill gradient banding. */
.nebula-backdrop__noise {
	position: absolute;
	inset: 0;
	opacity: 0.035;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   03. Preloader
   -------------------------------------------------------------------------- */

.nebula-preloader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.75rem;
	background: var(--wp--preset--color--base);
}

/* Only shown once JS confirms it can also remove it. */
.nebula-preloader.is-active {
	display: flex;
}

.nebula-preloader.is-leaving {
	animation: nebula-preloader-out 620ms var(--nebula-ease) forwards;
}

@keyframes nebula-preloader-out {
	to {
		opacity: 0;
		visibility: hidden;
		transform: scale(1.04);
	}
}

.nebula-preloader__mark {
	position: relative;
	width: 96px;
	height: 96px;
	display: grid;
	place-items: center;
}

.nebula-preloader__ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1px solid rgba(56, 182, 255, 0.35);
	border-top-color: var(--wp--preset--color--accent);
	animation: nebula-spin 1.15s linear infinite;
}

.nebula-preloader__ring:last-of-type {
	inset: 16px;
	border-color: rgba(139, 123, 255, 0.3);
	border-bottom-color: var(--wp--preset--color--accent-3);
	animation-duration: 1.7s;
	animation-direction: reverse;
}

.nebula-preloader__core {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 24px 4px rgba(56, 182, 255, 0.7);
	animation: nebula-pulse 1.6s ease-in-out infinite;
}

@keyframes nebula-spin {
	to { transform: rotate(360deg); }
}

@keyframes nebula-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50%      { transform: scale(1.5); opacity: 0.6; }
}

.nebula-preloader__label {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.nebula-preloader__bar {
	width: min(220px, 60vw);
	height: 2px;
	border-radius: 999px;
	background: rgba(234, 241, 255, 0.1);
	overflow: hidden;
}

.nebula-preloader__bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--wp--preset--color--accent-2), var(--wp--preset--color--accent-3));
	transition: width 240ms var(--nebula-ease);
}

/* --------------------------------------------------------------------------
   04. Reading progress
   -------------------------------------------------------------------------- */

.nebula-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 900;
	background: transparent;
	pointer-events: none;
}

.nebula-progress span {
	display: block;
	height: 100%;
	width: 0;
	transform-origin: left center;
	background: linear-gradient(90deg, var(--wp--preset--color--accent-2), var(--wp--preset--color--accent), var(--wp--preset--color--accent-3));
	box-shadow: 0 0 14px rgba(56, 182, 255, 0.7);
}

/* --------------------------------------------------------------------------
   05. Header & navigation
   -------------------------------------------------------------------------- */

.nebula-header {
	position: sticky;
	top: 0;
	z-index: 500;
	transition: background-color 320ms var(--nebula-ease), backdrop-filter 320ms var(--nebula-ease), border-color 320ms var(--nebula-ease);
	border-bottom: 1px solid transparent;
}

body.nebula-scrolled .nebula-header {
	background: rgba(5, 7, 12, 0.72);
	backdrop-filter: saturate(160%) blur(14px);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	border-bottom-color: rgba(234, 241, 255, 0.09);
}

/* Underline that grows from the centre on hover. */
.nebula-header .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.35rem;
}

.nebula-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 0;
	height: 1px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent-2), var(--wp--preset--color--accent-3));
	transform: translateX(-50%);
	transition: width 320ms var(--nebula-ease);
}

.nebula-header .wp-block-navigation-item__content:hover::after,
.nebula-header .current-menu-item > .wp-block-navigation-item__content::after {
	width: 100%;
}

/* Off-canvas menu on small screens. */
.wp-block-navigation__responsive-container.is-menu-open {
	background: rgba(5, 7, 12, 0.96) !important;
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   06. Buttons & links
   -------------------------------------------------------------------------- */

.wp-block-button__link {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: transform 260ms var(--nebula-ease), box-shadow 260ms var(--nebula-ease), color 200ms linear;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px -14px rgba(56, 182, 255, 0.75);
}

/* Sheen sweep. */
.wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
	transform: translateX(-120%);
	transition: transform 720ms var(--nebula-ease);
}

.wp-block-button__link:hover::after {
	transform: translateX(120%);
}

/* Primary gradient button variant. */
.wp-block-button.is-style-nebula-primary .wp-block-button__link,
.wp-block-button.nebula-btn-gradient .wp-block-button__link {
	background: linear-gradient(135deg, var(--wp--preset--color--accent) 0%, var(--wp--preset--color--accent-3) 100%);
	color: var(--wp--preset--color--white);
	box-shadow: 0 12px 34px -16px rgba(56, 182, 255, 0.9);
}

.wp-block-button.is-style-outline .wp-block-button__link::after {
	background: linear-gradient(110deg, transparent 20%, rgba(56, 182, 255, 0.28) 50%, transparent 80%);
}

/* Inline text links inside prose get an animated underline. */
.nebula-prose a:not(.wp-block-button__link):not(.wp-element-button) {
	background-image: linear-gradient(90deg, var(--wp--preset--color--accent), var(--wp--preset--color--accent-3));
	background-size: 0% 1px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 320ms var(--nebula-ease);
}

.nebula-prose a:not(.wp-block-button__link):not(.wp-element-button):hover {
	background-size: 100% 1px;
}

/* --------------------------------------------------------------------------
   07. Block styles
   -------------------------------------------------------------------------- */

/* Glass panel */
.is-style-nebula-glass {
	position: relative;
	border-radius: var(--wp--custom--radius--lg);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.02) 100%);
	border: 1px solid rgba(234, 241, 255, 0.1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 24px 60px -32px rgba(2, 6, 18, 0.9);
	overflow: hidden;
}

.is-style-nebula-glass:not(:has(.wp-block-image:only-child)) {
	padding: var(--wp--preset--spacing--50);
}

/* Top hairline highlight */
.is-style-nebula-glass::before {
	content: "";
	position: absolute;
	inset-inline: 12%;
	top: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(56, 182, 255, 0.75), transparent);
}

/* Glow border — animated conic ring */
.is-style-nebula-glow-border {
	position: relative;
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
	background: rgba(10, 15, 26, 0.72);
	isolation: isolate;
}

.is-style-nebula-glow-border::before {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	border-radius: inherit;
	background: conic-gradient(from var(--nebula-angle, 0deg), transparent 0deg, var(--wp--preset--color--accent) 70deg, var(--wp--preset--color--accent-3) 140deg, transparent 210deg, transparent 360deg);
	animation: nebula-rotate-angle 6s linear infinite;
}

.is-style-nebula-glow-border::after {
	content: "";
	position: absolute;
	inset: 1px;
	z-index: -1;
	border-radius: inherit;
	background: #0a0f1a;
}

@property --nebula-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

@keyframes nebula-rotate-angle {
	to { --nebula-angle: 360deg; }
}

/* Tilt card — transform driven by JS custom properties */
.is-style-nebula-tilt,
.nebula-tilt {
	position: relative;
	transform-style: preserve-3d;
	transition: transform 420ms var(--nebula-ease), box-shadow 420ms var(--nebula-ease);
	will-change: transform;
}

.is-style-nebula-tilt.is-tilting,
.nebula-tilt.is-tilting {
	transition: transform 90ms linear, box-shadow 420ms var(--nebula-ease);
	transform: perspective(900px)
		rotateX(var(--nebula-tilt-x, 0deg))
		rotateY(var(--nebula-tilt-y, 0deg))
		translate3d(0, -4px, 0);
}

/* Pointer-following glow inside tilt/glass cards */
.nebula-tilt::after,
.is-style-nebula-tilt::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0;
	transition: opacity 320ms var(--nebula-ease);
	background: radial-gradient(
		260px circle at var(--nebula-mx, 50%) var(--nebula-my, 50%),
		rgba(56, 182, 255, 0.22),
		transparent 65%
	);
}

.nebula-tilt.is-tilting::after,
.is-style-nebula-tilt.is-tilting::after {
	opacity: 1;
}

.is-style-nebula-tilt-children > .wp-block-column {
	transition: transform 420ms var(--nebula-ease);
}

/* Gradient text */
.is-style-nebula-gradient-text {
	background: linear-gradient(100deg, #eaf1ff 0%, var(--wp--preset--color--accent) 45%, var(--wp--preset--color--accent-3) 100%);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	animation: nebula-gradient-shift 9s ease-in-out infinite alternate;
}

@keyframes nebula-gradient-shift {
	from { background-position: 0% 50%; }
	to   { background-position: 100% 50%; }
}

/* Outline text */
.is-style-nebula-outline-text {
	color: transparent !important;
	-webkit-text-stroke: 1px rgba(234, 241, 255, 0.42);
}

/* Eyebrow */
.is-style-nebula-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.is-style-nebula-eyebrow::before {
	content: "";
	width: 28px;
	height: 1px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent), transparent);
}

/* inline-flex ignores text-align, so centre the box itself. */
.is-style-nebula-eyebrow.has-text-align-center {
	display: flex;
	justify-content: center;
	width: fit-content;
	margin-inline: auto;
}

/* Lead paragraph */
.is-style-nebula-lead {
	font-size: clamp(1.125rem, 1.6vw, 1.375rem);
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
	letter-spacing: -0.01em;
}

/* Image with glow frame */
.is-style-nebula-frame img {
	border-radius: var(--wp--custom--radius--lg);
}

.is-style-nebula-frame {
	position: relative;
}

.is-style-nebula-frame::before {
	content: "";
	position: absolute;
	inset: -14px;
	border-radius: var(--wp--custom--radius--xl);
	background: linear-gradient(135deg, rgba(56, 182, 255, 0.35), rgba(139, 123, 255, 0.18));
	filter: blur(26px);
	z-index: -1;
}

/* Spectrum separator */
.is-style-nebula-spectrum {
	height: 1px;
	border: 0;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--accent-2), var(--wp--preset--color--accent-3), transparent);
}

/* Checklist */
.is-style-nebula-checklist {
	list-style: none;
	padding-left: 0;
	display: grid;
	gap: 0.85rem;
}

.is-style-nebula-checklist li {
	position: relative;
	padding-left: 2rem;
	color: var(--wp--preset--color--muted);
}

.is-style-nebula-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: rgba(56, 182, 255, 0.14);
	border: 1px solid rgba(56, 182, 255, 0.5);
}

.is-style-nebula-checklist li::after {
	content: "";
	position: absolute;
	left: 0.36rem;
	top: 0.72em;
	width: 0.32rem;
	height: 0.6rem;
	border-right: 2px solid var(--wp--preset--color--accent);
	border-bottom: 2px solid var(--wp--preset--color--accent);
	transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   08. Scroll reveal
   -------------------------------------------------------------------------- */

/* Only applied once JS is running, so no-JS visitors always see content. */
.nebula-js [data-nebula-reveal] {
	opacity: 0;
	transform: translate3d(0, 26px, 0);
	transition: opacity 720ms var(--nebula-ease), transform 720ms var(--nebula-ease);
	transition-delay: var(--nebula-delay, 0ms);
}

.nebula-js [data-nebula-reveal].is-revealed {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------------------
   09. Marquee
   -------------------------------------------------------------------------- */

.nebula-marquee {
	--nebula-marquee-duration: 38s;
	position: relative;
	display: flex;
	overflow: hidden;
	gap: 0;
	padding-block: var(--wp--preset--spacing--40);
	border-block: 1px solid rgba(234, 241, 255, 0.08);
	mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
	user-select: none;
}

.nebula-marquee__track {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 3.5rem;
	padding-right: 3.5rem;
	animation: nebula-marquee var(--nebula-marquee-duration) linear infinite;
	will-change: transform;
}

.nebula-marquee:hover .nebula-marquee__track {
	animation-play-state: paused;
}

.nebula-marquee--reverse .nebula-marquee__track {
	animation-direction: reverse;
}

@keyframes nebula-marquee {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(-100%, 0, 0); }
}

.nebula-marquee__item {
	display: inline-flex;
	align-items: center;
	gap: 0.9rem;
	white-space: nowrap;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.25rem, 2.6vw, 2rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	color: rgba(234, 241, 255, 0.55);
	transition: color 260ms var(--nebula-ease);
}

.nebula-marquee__item:hover {
	color: var(--wp--preset--color--white);
}

.nebula-marquee__item::after {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 12px rgba(56, 182, 255, 0.9);
}

/* --------------------------------------------------------------------------
   10. Hero
   -------------------------------------------------------------------------- */

.nebula-hero {
	position: relative;
	min-height: min(92svh, 900px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.nebula-hero__title {
	font-size: clamp(2.5rem, 5.4vw, 5.5rem);
	line-height: 1;
	letter-spacing: -0.04em;
	text-wrap: balance;
}

/* Scramble target keeps a stable box so the layout never jumps. */
[data-nebula-scramble] {
	display: inline-block;
	min-width: 1ch;
}

[data-nebula-scramble] .nebula-scramble__char {
	display: inline-block;
}

[data-nebula-scramble] .nebula-scramble__char--ghost {
	color: var(--wp--preset--color--accent-2);
	opacity: 0.85;
}

/* Blinking caret for the typing variant. */
.nebula-caret::after {
	content: "";
	display: inline-block;
	width: 3px;
	height: 0.9em;
	margin-left: 0.12em;
	vertical-align: -0.08em;
	background: var(--wp--preset--color--accent);
	animation: nebula-caret 1s steps(2) infinite;
}

@keyframes nebula-caret {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0; }
}

/* Scroll cue */
.nebula-scroll-cue {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.65rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* Rotating role line under the headline */
.nebula-role {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	margin: 0 0 1.35rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: clamp(0.8rem, 1.1vw, 0.95rem);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-2);
}

.nebula-role__prompt {
	color: var(--wp--preset--color--accent-3);
	opacity: 0.8;
}

/* Technology badges under the hero buttons */
.nebula-hero__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 2.25rem;
}

/* Larger primary button for the main call to action */
.nebula-btn-lg .wp-block-button__link {
	padding: 1.05rem 2.2rem;
	font-size: 1rem;
}

/* Stage portrait ------------------------------------------------------- */

.nebula-portrait {
	position: relative;
	border-radius: var(--wp--custom--radius--xl);
	margin-inline: auto;
	max-width: 460px;
}

/* Ambient glow bleeding out of the frame. */
.nebula-portrait::before {
	content: "";
	position: absolute;
	inset: -12% -8% -6%;
	z-index: -1;
	border-radius: 40px;
	background:
		radial-gradient(60% 55% at 50% 25%, rgba(56, 182, 255, 0.38) 0%, transparent 70%),
		radial-gradient(55% 50% at 70% 80%, rgba(139, 123, 255, 0.30) 0%, transparent 72%);
	filter: blur(34px);
}

.nebula-portrait .wp-block-image {
	position: relative;
	margin: 0;
	border-radius: var(--wp--custom--radius--xl);
	overflow: hidden;
	border: 1px solid rgba(234, 241, 255, 0.12);
	box-shadow: 0 40px 90px -40px rgba(2, 6, 18, 1);
}

.nebula-portrait .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}

/* Cool wash + bottom vignette so the photo melts into the dark page. */
.nebula-portrait .wp-block-image::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(5, 7, 12, 0.28) 0%, transparent 22%, transparent 55%, rgba(5, 7, 12, 0.72) 100%),
		linear-gradient(135deg, rgba(56, 182, 255, 0.12) 0%, rgba(139, 123, 255, 0.10) 100%);
}

/* Floating credential card overlapping the frame. */
.nebula-portrait__card {
	position: relative;
	z-index: 2;
	margin: -3.25rem 1.25rem 0;
	padding: 1.1rem 1.35rem;
	border-radius: var(--wp--custom--radius--lg);
	background: rgba(12, 18, 32, 0.78);
	border: 1px solid rgba(234, 241, 255, 0.14);
	backdrop-filter: blur(14px) saturate(150%);
	-webkit-backdrop-filter: blur(14px) saturate(150%);
	box-shadow: 0 24px 50px -26px rgba(2, 6, 18, 0.95);
}

.nebula-scroll-cue::after {
	content: "";
	width: 1px;
	height: 52px;
	background: linear-gradient(180deg, var(--wp--preset--color--accent), transparent);
	animation: nebula-cue 2.4s ease-in-out infinite;
	transform-origin: top center;
}

@keyframes nebula-cue {
	0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
	50%      { transform: scaleY(1);    opacity: 1; }
}

/* --------------------------------------------------------------------------
   11. Cards, stats & post grid
   -------------------------------------------------------------------------- */

.nebula-card {
	position: relative;
	height: 100%;
	padding: var(--wp--preset--spacing--50);
	border-radius: var(--wp--custom--radius--lg);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 100%);
	border: 1px solid rgba(234, 241, 255, 0.09);
	overflow: hidden;
	transition: border-color 320ms var(--nebula-ease), transform 420ms var(--nebula-ease);
}

.nebula-card:hover {
	border-color: rgba(56, 182, 255, 0.4);
}

.nebula-card__index {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	color: var(--wp--preset--color--accent);
}

/* Technology pills inside the skill cards */
.nebula-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0.35rem 0 0;
	padding: 0;
	list-style: none;
}

.nebula-tags li {
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	border: 1px solid rgba(234, 241, 255, 0.12);
	background: rgba(234, 241, 255, 0.035);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--muted);
	transition: border-color 260ms var(--nebula-ease), color 260ms var(--nebula-ease);
}

.nebula-card:hover .nebula-tags li {
	border-color: rgba(56, 182, 255, 0.3);
	color: rgba(234, 241, 255, 0.9);
}

/* "+N more" card */
.nebula-card--ghost {
	display: grid;
	place-items: center;
	border-style: dashed;
	min-height: 200px;
}

/* Credly certification wall ------------------------------------------- */

.nebula-certs {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.nebula-certs__item {
	border-radius: var(--wp--custom--radius--lg);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 100%);
	border: 1px solid rgba(234, 241, 255, 0.09);
	overflow: hidden;
	transition: border-color 320ms var(--nebula-ease), box-shadow 420ms var(--nebula-ease);
}

.nebula-certs__item:hover {
	border-color: rgba(56, 182, 255, 0.42);
	box-shadow: 0 24px 50px -28px rgba(56, 182, 255, 0.55);
}

.nebula-certs__link {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	min-height: 100%;
	color: inherit;
}

.nebula-certs__badge {
	flex: 0 0 auto;
	width: 68px;
	height: 68px;
	object-fit: contain;
	filter: drop-shadow(0 6px 16px rgba(2, 6, 18, 0.6));
	transition: transform 420ms var(--nebula-ease);
}

.nebula-certs__item:hover .nebula-certs__badge {
	transform: scale(1.07) rotate(-2deg);
}

.nebula-certs__body {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.nebula-certs__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.98rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.3;
	color: var(--wp--preset--color--contrast);
	text-wrap: balance;
}

.nebula-certs__issuer {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.nebula-certs__item--more {
	border-style: dashed;
}

.nebula-certs__item--more .nebula-certs__link {
	gap: 0.9rem;
}

.nebula-card__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	text-align: center;
}

/* Career timeline ------------------------------------------------------ */

.nebula-timeline {
	position: relative;
	margin: 0;
	padding: 0 0 0 5.5rem;
	list-style: none;
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

/* The rail */
.nebula-timeline::before {
	content: "";
	position: absolute;
	left: 4.25rem;
	top: 0.6rem;
	bottom: 0.6rem;
	width: 1px;
	background: linear-gradient(180deg, transparent, rgba(56, 182, 255, 0.55) 12%, rgba(139, 123, 255, 0.45) 88%, transparent);
}

.nebula-timeline__item {
	position: relative;
	padding: 1.35rem 1.5rem;
	border-radius: var(--wp--custom--radius--lg);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.012) 100%);
	border: 1px solid rgba(234, 241, 255, 0.08);
	transition: border-color 320ms var(--nebula-ease), transform 420ms var(--nebula-ease);
}

.nebula-timeline__item:hover {
	border-color: rgba(56, 182, 255, 0.35);
	transform: translateX(4px);
}

/* Node on the rail */
.nebula-timeline__item::before {
	content: "";
	position: absolute;
	left: -1.31rem;
	top: 1.75rem;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.16), 0 0 14px rgba(56, 182, 255, 0.8);
}

.nebula-timeline__year {
	position: absolute;
	left: -5.5rem;
	top: 1.35rem;
	width: 3.5rem;
	text-align: right;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--accent-2);
}

.nebula-timeline__org {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.nebula-timeline__role {
	margin: 0.4rem 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--wp--preset--color--contrast);
}

.nebula-timeline__note {
	margin: 0.6rem 0 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

/* Statistics grid ------------------------------------------------------ */

.nebula-stat-grid {
	display: grid;
	gap: 2.5rem;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.nebula-stat-grid .nebula-stat__label {
	display: block;
	margin-top: 0.65rem;
	max-width: 22ch;
	overflow-wrap: normal;
	word-break: keep-all;
	hyphens: none;
}

/* Photo wall ----------------------------------------------------------- */

.nebula-gallery {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.nebula-gallery__item {
	position: relative;
	margin: 0;
	border-radius: var(--wp--custom--radius--lg);
	overflow: hidden;
	border: 1px solid rgba(234, 241, 255, 0.1);
	background: var(--wp--preset--color--base-deep);
	aspect-ratio: 3 / 2;
	transform: scale(1);
	transform-origin: center;
	will-change: transform;
	transition:
		transform 620ms var(--nebula-ease),
		opacity 480ms var(--nebula-ease),
		border-color 420ms var(--nebula-ease),
		box-shadow 620ms var(--nebula-ease);
}

.nebula-gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: saturate(0.92);
	transform: scale(1);
	transition: transform 900ms var(--nebula-ease), filter 620ms var(--nebula-ease);
}

/* The hovered photo lifts above its neighbours and grows just enough to read.
   Specificity is deliberately matched to the sibling rule below, and to the
   scroll-reveal rule that also sets `transform` on these figures. */
.nebula-gallery:hover .nebula-gallery__item:hover {
	z-index: 3;
	transform: scale(1.075);
	opacity: 1;
	border-color: rgba(56, 182, 255, 0.5);
	box-shadow: 0 34px 70px -28px rgba(2, 6, 18, 0.95), 0 0 0 1px rgba(56, 182, 255, 0.28);
}

.nebula-gallery__item:hover img {
	transform: scale(1.06);
	filter: saturate(1.08);
}

/* Everything else steps back, so attention lands on one photo at a time. */
.nebula-gallery:hover .nebula-gallery__item:not(:hover) {
	opacity: 0.55;
	transform: scale(0.975);
}

/* Cool tint so the photos sit in the palette */
.nebula-gallery__item::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(5, 7, 12, 0) 45%, rgba(5, 7, 12, 0.55) 100%),
		linear-gradient(135deg, rgba(56, 182, 255, 0.10), rgba(139, 123, 255, 0.08));
	transition: opacity 620ms var(--nebula-ease);
}

.nebula-gallery__item:hover::before {
	opacity: 0.25;
}

/* Big animated numbers */
.nebula-stat {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 600;
	letter-spacing: -0.04em;
	line-height: 1;
	white-space: nowrap;
	background: linear-gradient(135deg, #eaf1ff, var(--wp--preset--color--accent));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-variant-numeric: tabular-nums;
}

.nebula-stat__label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* Query loop cards */
.is-style-nebula-post-grid .wp-block-post {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.25rem;
	border-radius: var(--wp--custom--radius--lg);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 100%);
	border: 1px solid rgba(234, 241, 255, 0.09);
	transition: transform 420ms var(--nebula-ease), border-color 320ms var(--nebula-ease), box-shadow 420ms var(--nebula-ease);
	overflow: hidden;
}

.is-style-nebula-post-grid .wp-block-post:hover {
	transform: translateY(-6px);
	border-color: rgba(56, 182, 255, 0.4);
	box-shadow: 0 28px 60px -30px rgba(56, 182, 255, 0.55);
}

.is-style-nebula-post-grid .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--md);
	transition: transform 720ms var(--nebula-ease);
}

.is-style-nebula-post-grid .wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.05);
}

.is-style-nebula-post-grid .wp-block-post-featured-image {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--md);
	margin: 0;
}

.is-style-nebula-post-grid .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	transition: color 220ms var(--nebula-ease);
}

.is-style-nebula-post-grid .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* Logo / badge strip */
.nebula-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.9rem;
	border-radius: 999px;
	border: 1px solid rgba(234, 241, 255, 0.14);
	background: rgba(234, 241, 255, 0.04);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.nebula-badge__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-2);
	box-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
	animation: nebula-pulse 2.4s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   12. Single post & page content
   -------------------------------------------------------------------------- */

.nebula-prose {
	font-size: 1.0625rem;
	line-height: 1.75;
	color: rgba(234, 241, 255, 0.86);
}

.nebula-prose > * + * {
	margin-top: 1.35em;
}

.nebula-prose h2,
.nebula-prose h3,
.nebula-prose h4 {
	margin-top: 2.2em;
	margin-bottom: 0.6em;
	scroll-margin-top: calc(var(--nebula-header-height) + 2rem);
}

.nebula-prose figure {
	margin-block: 2.4em;
}

.nebula-prose :where(code):not(.wp-block-code code) {
	padding: 0.15em 0.45em;
	border-radius: 6px;
	background: rgba(56, 182, 255, 0.12);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9em;
	color: var(--wp--preset--color--accent-2);
}

/* Post meta row */
.nebula-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
}

/* Featured image on single posts */
.nebula-featured img {
	width: 100%;
	border-radius: var(--wp--custom--radius--xl);
	box-shadow: 0 40px 90px -50px rgba(2, 6, 18, 1);
}

/* Pagination */
.wp-block-query-pagination {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
	letter-spacing: 0.06em;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.4rem;
	height: 2.4rem;
	padding-inline: 0.5rem;
	border-radius: 999px;
	border: 1px solid rgba(234, 241, 255, 0.1);
	transition: all 260ms var(--nebula-ease);
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-numbers .page-numbers.current {
	border-color: rgba(56, 182, 255, 0.55);
	background: rgba(56, 182, 255, 0.12);
	color: var(--wp--preset--color--white);
}

/* Search form */
.wp-block-search__input {
	border-radius: 999px !important;
	border: 1px solid rgba(234, 241, 255, 0.14) !important;
	background: rgba(234, 241, 255, 0.04) !important;
	color: var(--wp--preset--color--contrast) !important;
	padding: 0.85rem 1.4rem !important;
}

.wp-block-search__input::placeholder {
	color: rgba(147, 164, 196, 0.7);
}

.wp-block-search__input:focus {
	outline: none;
	border-color: rgba(56, 182, 255, 0.6) !important;
	box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.14);
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.nebula-footer {
	position: relative;
	border-top: 1px solid rgba(234, 241, 255, 0.08);
	background: linear-gradient(180deg, rgba(10, 15, 26, 0) 0%, rgba(10, 15, 26, 0.85) 100%);
}

.nebula-footer a {
	color: var(--wp--preset--color--muted);
	transition: color 220ms var(--nebula-ease);
}

.nebula-footer a:hover {
	color: var(--wp--preset--color--accent);
}

.nebula-social {
	display: flex;
	gap: 0.75rem;
}

.nebula-footer__nav {
	list-style: none;
	padding-left: 0;
	line-height: 2;
}

/* --------------------------------------------------------------------------
   14. Utilities, a11y & reduced motion
   -------------------------------------------------------------------------- */

.nebula-skip-link {
	position: absolute;
	top: -100px;
	left: 1rem;
	z-index: 10000;
	padding: 0.75rem 1.25rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
	color: #04060b;
	font-weight: 600;
}

.nebula-skip-link:focus {
	top: 1rem;
	clip: auto !important;
	clip-path: none;
	width: auto;
	height: auto;
	white-space: normal;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.nebula-divider-glow {
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(56, 182, 255, 0.55), transparent);
}

@media (max-width: 781px) {
	.nebula-hero {
		min-height: auto;
		padding-block: var(--wp--preset--spacing--70);
	}

	.is-style-nebula-glass:not(:has(.wp-block-image:only-child)),
	.is-style-nebula-glow-border,
	.nebula-card {
		padding: var(--wp--preset--spacing--40);
	}

	.nebula-backdrop__grid {
		background-size: 44px 44px;
	}

	/* Timeline: move the year inside the card and shorten the rail. */
	.nebula-timeline {
		padding-left: 1.6rem;
	}

	.nebula-timeline::before {
		left: 0.35rem;
	}

	.nebula-timeline__item::before {
		left: -1.5rem;
		top: 1.6rem;
	}

	.nebula-timeline__year {
		position: static;
		display: block;
		width: auto;
		text-align: left;
		margin-bottom: 0.4rem;
	}
}

/* Respect the OS setting: kill every non-essential animation. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	.nebula-js [data-nebula-reveal] {
		opacity: 1;
		transform: none;
	}

	.nebula-backdrop__canvas,
	.nebula-backdrop__aurora {
		display: none;
	}

	.nebula-marquee__track {
		animation: none;
		transform: none;
	}
}
