/* FittingByMe Demo — design utilities & motion */

:root {
	--fby-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--fby-shadow-sm: 0 4px 20px rgba(15, 23, 42, 0.06);
	--fby-shadow-md: 0 12px 40px rgba(79, 70, 229, 0.12);
	--fby-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
	--fby-radius: 20px;
	--fby-radius-lg: 28px;
}

body {
	-webkit-font-smoothing: antialiased;
}

/* Typography helpers */
.fby-display {
	font-family: "Instrument Serif", Georgia, serif !important;
	font-weight: 400 !important;
	letter-spacing: -0.02em;
}

.fby-label {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--indigo);
}

/* Surfaces */
.fby-surface-alt {
	background: var(--wp--preset--color--surface-alt);
}

.fby-gradient-hero {
	background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 42%, #fdf4ff 100%);
	position: relative;
	overflow: hidden;
}

.fby-gradient-hero::before {
	content: "";
	position: absolute;
	width: 480px;
	height: 480px;
	top: -120px;
	right: -80px;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
	border-radius: 50%;
	animation: fby-float 8s ease-in-out infinite;
	pointer-events: none;
}

.fby-gradient-hero::after {
	content: "";
	position: absolute;
	width: 320px;
	height: 320px;
	bottom: -60px;
	left: -40px;
	background: radial-gradient(circle, rgba(167, 139, 250, 0.2) 0%, transparent 70%);
	border-radius: 50%;
	animation: fby-float 10s ease-in-out infinite reverse;
	pointer-events: none;
}

.fby-border {
	border: 1px solid var(--wp--preset--color--border);
}

.fby-rounded {
	border-radius: var(--fby-radius);
}

.fby-rounded-lg {
	border-radius: var(--fby-radius-lg);
}

.fby-shadow {
	box-shadow: var(--fby-shadow-sm);
	transition: box-shadow 0.4s var(--fby-ease), transform 0.4s var(--fby-ease);
}

.fby-shadow:hover {
	box-shadow: var(--fby-shadow-md);
}

.fby-card-hover:hover {
	transform: translateY(-6px);
	box-shadow: var(--fby-shadow-lg);
}

/* Header */
.fby-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(14px);
	background: rgba(255, 255, 255, 0.85) !important;
	transition: box-shadow 0.3s var(--fby-ease);
}

.fby-header.is-scrolled {
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

/* Images */
.fby-img-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.fby-img-frame {
	overflow: hidden;
	border-radius: var(--fby-radius-lg);
	box-shadow: var(--fby-shadow-md);
}

.fby-img-tilt {
	transform: rotate(-2deg);
	transition: transform 0.5s var(--fby-ease);
}

.fby-img-tilt:hover {
	transform: rotate(0deg) scale(1.02);
}

.fby-collage {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto;
}

.fby-collage .fby-collage-main {
	grid-row: span 2;
}

/* Badges */
.fby-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--wp--preset--color--border);
	font-size: 0.8125rem;
	font-weight: 600;
	box-shadow: var(--fby-shadow-sm);
	animation: fby-pulse-soft 3s ease-in-out infinite;
}

.fby-badge-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

/* Stats */
.fby-stat {
	text-align: center;
	padding: 1.5rem;
}

.fby-stat-number {
	font-family: "Instrument Serif", Georgia, serif;
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1;
	color: var(--wp--preset--color--indigo);
}

/* Marquee strip */
.fby-marquee-wrap {
	overflow: hidden;
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.fby-marquee {
	display: flex;
	gap: 1rem;
	width: max-content;
	animation: fby-marquee 28s linear infinite;
}

.fby-marquee img {
	width: 200px;
	height: 260px;
	object-fit: cover;
	border-radius: 16px;
	flex-shrink: 0;
}

/* Plugin showcase box */
.fby-plugin-box {
	background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--fby-radius);
	padding: 2rem;
	text-align: center;
}

/* Scroll reveal */
.fby-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s var(--fby-ease), transform 0.7s var(--fby-ease);
}

.fby-reveal.fby-visible {
	opacity: 1;
	transform: translateY(0);
}

.fby-reveal-delay-1 { transition-delay: 0.1s; }
.fby-reveal-delay-2 { transition-delay: 0.2s; }
.fby-reveal-delay-3 { transition-delay: 0.3s; }

/* Stagger children */
.fby-stagger > * {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.55s var(--fby-ease), transform 0.55s var(--fby-ease);
}

.fby-stagger.fby-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
.fby-stagger.fby-visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: none; }
.fby-stagger.fby-visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: none; }
.fby-stagger.fby-visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: none; }

/* Buttons micro-interaction */
.wp-block-button__link {
	transition: transform 0.25s var(--fby-ease), box-shadow 0.25s var(--fby-ease) !important;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* Footer */
.fby-footer {
	background: var(--wp--preset--color--ink) !important;
	color: #94a3b8;
}

.fby-footer a {
	color: #e2e8f0;
	text-decoration: none;
}

.fby-footer a:hover {
	color: #fff;
}

/* WooCommerce polish */
.woocommerce .fittingbyme-tryon-button,
.woocommerce .fittingbyme-tryon-notice {
	margin-top: 1rem;
}

/* Keyframes */
@keyframes fby-float {
	0%, 100% { transform: translate(0, 0); }
	50% { transform: translate(12px, -16px); }
}

@keyframes fby-pulse-soft {
	0%, 100% { box-shadow: var(--fby-shadow-sm); }
	50% { box-shadow: 0 6px 28px rgba(99, 102, 241, 0.15); }
}

@keyframes fby-marquee {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

@keyframes fby-shimmer {
	0% { background-position: -200% 0; }
	100% { background-position: 200% 0; }
}

.fby-shimmer {
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
	background-size: 200% 100%;
	animation: fby-shimmer 2.5s infinite;
}

@media (prefers-reduced-motion: reduce) {
	.fby-reveal,
	.fby-stagger > *,
	.fby-marquee,
	.fby-gradient-hero::before,
	.fby-gradient-hero::after,
	.fby-badge {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}
