/**
 * Badge Card — Share page
 *
 * Trading-card style page for /card/badge/{username}/{slug}/.
 * Modeled on the WordPress 7.0 contributor card aesthetic
 * (release-share.css) but simplified for the badge context:
 *
 *   - Portrait card, badge-color-driven accent gradient
 *   - 3D mouse tilt + cursor-tracking holographic shine
 *   - Entrance animation + fireworks burst on first paint
 *   - Reduced-motion path drops every animation
 *
 * Variables driven from PHP (via inline style on body):
 *   --accent  — badge.color from registry, drives the gradient
 *   --accent-soft — same colour at lower alpha for ambient glow
 *
 * Color tokens:
 *   --bg            #0a0e1a   page background, deep navy
 *   --card-top      #1a1f2e   card gradient top
 *   --card-bottom   #11141e   card gradient bottom
 *   --border        #2A3142   card outline
 *   --text-main     #E8EAED   display name, badge label
 *   --text-sub      #A1A6B4   handle, description
 *   --text-dim      #6B7280   footer / meta lines
 *
 * @since 1.22.644
 */

/* ────────────────────────────────────────────────────────────
 * Reset + page shell
 * ──────────────────────────────────────────────────────────── */

.bc-share-html, .bc-share-body {
	margin: 0;
	padding: 0;
}

.bc-share-body {
	min-height: 100vh;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	/* 1.22.645 — Mix the accent with white before applying alpha so
	 * dark accents (Verified #2145e6, Note Taker #2145e6, Curator
	 * #11799d) still produce a luminous radial glow against the
	 * near-black background. Without the white mix, dark-on-dark
	 * accents made the page feel monochrome and dead. */
	--accent-lift: color-mix(in srgb, var(--accent, #2145e6) 55%, #ffffff);
	background:
		radial-gradient(ellipse 80% 50% at 50% 0%,
			color-mix(in srgb, var(--accent-lift) 38%, transparent) 0%,
			transparent 70%
		),
		radial-gradient(ellipse 60% 40% at 50% 100%,
			color-mix(in srgb, var(--accent-lift) 18%, transparent) 0%,
			transparent 65%
		),
		linear-gradient(180deg, #0a0e1a 0%, #060912 100%);
	color: #E8EAED;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 56px 24px 80px;
	box-sizing: border-box;
	overflow-x: hidden;
}

/* Faint dot pattern across the whole page for depth */
.bc-share-body::before {
	content: '';
	position: fixed;
	inset: 0;
	background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
	background-size: 24px 24px;
	pointer-events: none;
	z-index: 0;
}

.bc-stage {
	position: relative;
	z-index: 1;
	max-width: 420px;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* ────────────────────────────────────────────────────────────
 * Brand block (above card)
 * ──────────────────────────────────────────────────────────── */

.bc-brand {
	text-align: center;
	margin-bottom: 24px;
}
/* 1.22.646 — Brand logo replaces the wordmark + accent-dot combo. */
.bc-brand__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	line-height: 0;
	transition: opacity 0.15s ease;
}
.bc-brand__logo img {
	height: 28px;
	width: auto;
	display: block;
}
.bc-brand__logo:hover {
	opacity: 0.85;
}
.bc-brand__sub {
	margin: 10px 0 0;
	font-size: 11px;
	font-weight: 600;
	color: #A1A6B4;
	text-transform: uppercase;
	letter-spacing: 2px;
}

/* ────────────────────────────────────────────────────────────
 * Card
 * ──────────────────────────────────────────────────────────── */

.bc-card {
	position: relative;
	width: 360px;
	max-width: 100%;
	border-radius: 24px;
	padding: 38px 30px 28px;
	background:
		linear-gradient(180deg,
			color-mix(in srgb, var(--accent, #2145e6) 6%, #1a1f2e) 0%,
			#11141e 100%
		);
	box-shadow:
		0 36px 80px -30px rgba(0,0,0,0.7),
		0 14px 30px -10px color-mix(in srgb, var(--accent, #2145e6) 30%, transparent),
		inset 0 1px 0 rgba(255,255,255,0.04);

	/* 3D mouse-tilt — set by JS */
	--tilt-rx: 0deg;
	--tilt-ry: 0deg;
	--shine-x: 50%;
	--shine-y: 50%;
	transform: perspective(1000px) rotateX(var(--tilt-rx)) rotateY(var(--tilt-ry));
	transition: transform 0.12s ease-out;
	transform-style: preserve-3d;
	will-change: transform;

	/* Entrance animation */
	animation: bc-card-enter 0.6s ease-out both;
}

/* Gradient border via pseudo-element */
.bc-card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 24px;
	padding: 1px;
	background: linear-gradient(135deg,
		color-mix(in srgb, var(--accent, #2145e6) 80%, transparent) 0%,
		rgba(255,255,255,0.10) 50%,
		color-mix(in srgb, var(--accent, #2145e6) 40%, transparent) 100%
	);
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

/* Holographic shine — follows cursor */
.bc-card::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 24px;
	background: radial-gradient(circle at var(--shine-x) var(--shine-y),
		rgba(255,255,255,0.18) 0%,
		rgba(255,255,255,0.06) 18%,
		transparent 42%
	);
	mix-blend-mode: screen;
	opacity: 0;
	transition: opacity 0.25s ease-out;
	pointer-events: none;
}
.bc-card:hover::after {
	opacity: 1;
}

@keyframes bc-card-enter {
	from {
		opacity: 0;
		transform: perspective(1000px) translateY(28px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: perspective(1000px) translateY(0) scale(1);
	}
}

/* ────────────────────────────────────────────────────────────
 * Card content
 * ──────────────────────────────────────────────────────────── */

.bc-card__eyebrow {
	margin: 0 0 22px;
	font-size: 10.5px;
	font-weight: 700;
	color: #ffffff;
	text-transform: uppercase;
	letter-spacing: 2.4px;
	text-align: center;
}

.bc-card__avatar-wrap {
	position: relative;
	width: 132px;
	height: 132px;
	margin: 0 auto 20px;
	border-radius: 999px;
	display: grid;
	place-items: center;
}
.bc-card__avatar-glow {
	position: absolute;
	inset: -10px;
	border-radius: 999px;
	background: radial-gradient(circle, var(--accent, #2145e6) 0%, transparent 70%);
	opacity: 0.55;
	filter: blur(10px);
	animation: bc-glow-pulse 3.5s ease-in-out infinite;
	pointer-events: none;
}
.bc-card__avatar-ring {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: conic-gradient(
		from var(--ring-rot, 0deg),
		var(--accent, #2145e6) 0deg,
		color-mix(in srgb, var(--accent, #2145e6) 30%, #ffffff) 90deg,
		var(--accent, #2145e6) 180deg,
		color-mix(in srgb, var(--accent, #2145e6) 30%, #ffffff) 270deg,
		var(--accent, #2145e6) 360deg
	);
	padding: 3px;
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: bc-ring-spin 8s linear infinite;
}
.bc-card__avatar {
	width: 122px;
	height: 122px;
	border-radius: 999px;
	display: block;
	background: #0a0e1a;
	object-fit: cover;
	position: relative;
	z-index: 1;
}
/* 1.22.658 — Initials variant. Used when the folk has no Gravatar.
 * Background gets the user-specific brand color via inline style so
 * the card stays personal even without a photo. */
.bc-card__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 44px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: uppercase;
}

@keyframes bc-glow-pulse {
	0%, 100% { opacity: 0.4; transform: scale(1); }
	50%      { opacity: 0.65; transform: scale(1.06); }
}
@keyframes bc-ring-spin {
	to { --ring-rot: 360deg; }
}
@property --ring-rot {
	syntax: '<angle>';
	initial-value: 0deg;
	inherits: false;
}

.bc-card__name {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: #E8EAED;
	text-align: center;
	letter-spacing: -0.2px;
}
.bc-card__handle {
	display: block;
	margin: 0 0 22px;
	font-size: 13.5px;
	font-weight: 500;
	color: #A1A6B4;
	text-align: center;
	text-decoration: none;
}
.bc-card__handle:hover {
	color: #E8EAED;
}

.bc-card__divider {
	height: 1px;
	margin: 0 -10px 22px;
	background: linear-gradient(90deg,
		transparent 0%,
		rgba(255,255,255,0.12) 50%,
		transparent 100%
	);
}

/* 1.22.647 — Route accent-driven text through --accent-lift so dark
 * badge colors (Modern PHP #4338ca, Verified #2145e6, Curator #11799d)
 * stay legible against the near-black card. Raw accent only safe for
 * decorative fills (glow, ring) where it lands on a brighter base. */
.bc-card__badge-label {
	margin: 0 0 10px;
	font-size: 32px;
	font-weight: 800;
	color: var(--accent-lift, #2145e6);
	text-align: center;
	line-height: 1.1;
	letter-spacing: -0.5px;
	text-shadow: 0 0 24px color-mix(in srgb, var(--accent-lift, #2145e6) 50%, transparent);
}

.bc-card__badge-tag {
	display: block;
	margin: 0 auto 18px;
	width: fit-content;
	padding: 4px 12px;
	font-size: 10.5px;
	font-weight: 700;
	color: var(--accent-lift, #2145e6);
	background: color-mix(in srgb, var(--accent-lift, #2145e6) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--accent-lift, #2145e6) 40%, transparent);
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
}

.bc-card__desc {
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.55;
	color: #A1A6B4;
	text-align: center;
}

.bc-card__stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 0 0 22px;
	padding: 14px 0 4px;
	border-top: 1px solid rgba(255,255,255,0.06);
}
.bc-card__stat {
	text-align: center;
}
.bc-card__stat-value {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: #E8EAED;
	letter-spacing: -0.3px;
}
.bc-card__stat-label {
	display: block;
	margin-top: 2px;
	font-size: 10px;
	font-weight: 600;
	color: #6B7280;
	text-transform: uppercase;
	letter-spacing: 1.2px;
}

.bc-card__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid rgba(255,255,255,0.04);
	font-size: 11px;
	font-weight: 600;
	color: #6B7280;
	letter-spacing: 0.5px;
}
.bc-card__footer a {
	color: #6B7280;
	text-decoration: none;
	transition: color 0.15s ease;
}
.bc-card__footer a:hover {
	color: #E8EAED;
}
.bc-card__footer-wpf {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.bc-card__footer-wpf::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--accent, #2145e6);
}

/* ────────────────────────────────────────────────────────────
 * Actions row
 * ──────────────────────────────────────────────────────────── */

.bc-actions {
	margin: 32px 0 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	z-index: 1;
	position: relative;
}

.bc-cta {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 13px 28px;
	font-size: 14.5px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg,
		var(--accent, #2145e6) 0%,
		color-mix(in srgb, var(--accent, #2145e6) 70%, #ffffff) 100%
	);
	border: 1px solid color-mix(in srgb, var(--accent, #2145e6) 60%, #ffffff);
	border-radius: 12px;
	text-decoration: none;
	box-shadow:
		0 10px 24px -8px color-mix(in srgb, var(--accent, #2145e6) 60%, transparent),
		inset 0 1px 0 rgba(255,255,255,0.18);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
}
.bc-cta:hover {
	transform: translateY(-2px);
	box-shadow:
		0 16px 32px -10px color-mix(in srgb, var(--accent, #2145e6) 70%, transparent),
		inset 0 1px 0 rgba(255,255,255,0.22);
}

.bc-secondary {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
}
.bc-secondary a, .bc-secondary button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #E8EAED;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.10);
	border-radius: 9px;
	text-decoration: none;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, border-color 0.15s;
}
.bc-secondary a:hover, .bc-secondary button:hover {
	background: rgba(255,255,255,0.10);
	border-color: rgba(255,255,255,0.20);
}
.bc-secondary button[disabled] {
	opacity: 0.55;
	cursor: progress;
	pointer-events: none;
}

/* ────────────────────────────────────────────────────────────
 * Join CTA (referral) — shown to non-owner viewers
 * 1.22.646
 * ──────────────────────────────────────────────────────────── */

.bc-join {
	margin-top: 28px;
	display: inline-flex;
	align-items: center;
	gap: 16px;
	padding: 12px 14px 12px 20px;
	max-width: 100%;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.10);
	border-radius: 14px;
	text-decoration: none;
	color: #E8EAED;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	z-index: 1;
	position: relative;
}
.bc-join:hover {
	background: rgba(255,255,255,0.07);
	border-color: color-mix(in srgb, var(--accent, #2145e6) 50%, rgba(255,255,255,0.10));
	transform: translateY(-1px);
}
.bc-join__label {
	font-size: 13px;
	font-weight: 500;
	color: #A1A6B4;
	line-height: 1.35;
}
.bc-join__cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg,
		var(--accent, #2145e6) 0%,
		color-mix(in srgb, var(--accent, #2145e6) 70%, #ffffff) 100%
	);
	border-radius: 9px;
	box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent, #2145e6) 60%, transparent);
	white-space: nowrap;
	flex-shrink: 0;
}

@media (max-width: 480px) {
	.bc-join {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		gap: 12px;
		padding: 16px;
	}
	.bc-join__cta {
		justify-content: center;
	}
}

.bc-back {
	margin-top: 28px;
	font-size: 13px;
	color: #A1A6B4;
	text-decoration: none;
	z-index: 1;
	position: relative;
}
.bc-back:hover {
	color: #E8EAED;
}

.bc-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	background: #10B981;
	color: #fff;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
	z-index: 1000;
}
.bc-toast.is-visible {
	opacity: 1;
}

/* ────────────────────────────────────────────────────────────
 * Reduced motion — drop every animation
 * ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bc-card { animation: none; transition: none; }
	.bc-card__avatar-glow,
	.bc-card__avatar-ring { animation: none; }
}

/* ────────────────────────────────────────────────────────────
 * Small-viewport adjustments
 * ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	.bc-share-body { padding: 32px 16px 64px; }
	.bc-card { width: 100%; padding: 32px 24px 24px; }
	.bc-card__badge-label { font-size: 28px; }
	.bc-card__avatar-wrap { width: 116px; height: 116px; }
	.bc-card__avatar { width: 110px; height: 110px; }
}
