/*
 * Homepage (landing template) visual layer, loaded by inc/home-menu.php.
 * Adds depth and motion on top of the page's own styles; nothing here hides
 * content, and all movement stops for visitors who ask for reduced motion.
 */

/* Menu links from the Homepage menu (own class, so the page's section-spy script leaves them alone). */
.bc-nav-link { position: relative; transition: color .2s; }
.bc-nav-link::after {
	content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 2px;
	background: linear-gradient(90deg, #EF4444, #A855F7);
	transform: scaleX(0); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.bc-nav-link:hover::after, .bc-nav-link.is-current::after { transform: scaleX(1); }

/* Fine film grain over the whole page for a richer, less flat dark background. */
body::after {
	content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .045;
	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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Hero: soft glow that follows the pointer, and layers that drift apart on scroll. */
.fx-hero { --hp: 0; }
.fx-hero-glow {
	position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
	background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 40%), rgba(168, 85, 247, .14), rgba(239, 68, 68, .06) 40%, transparent 70%);
}
.fx-hero:hover .fx-hero-glow { opacity: 1; }
.fx-hero .orb-a { translate: 0 calc(var(--hp) * 160px); }
.fx-hero .orb-b { translate: 0 calc(var(--hp) * -90px); }
.fx-hero-copy { translate: 0 calc(var(--hp) * -50px); opacity: calc(1 - var(--hp) * .85); will-change: translate, opacity; }
.fx-hero-art { translate: 0 calc(var(--hp) * 70px); scale: calc(1 - var(--hp) * .06); will-change: translate, scale; }

/* Section dividers: a glowing line draws out from the centre as each section arrives. */
.fx-section { position: relative; }
.fx-section::before {
	content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px; pointer-events: none;
	background: linear-gradient(90deg, transparent, rgba(239, 68, 68, .7), rgba(168, 85, 247, .7), transparent);
	box-shadow: 0 0 18px rgba(239, 68, 68, .35);
	transform: scaleX(0); transition: transform 1.4s cubic-bezier(.2, .7, .2, 1);
}
.fx-section.fx-in::before { transform: scaleX(1); }

/* Section titles: a short accent bar slides in under each heading. */
.fx-title { position: relative; }
.fx-title::after {
	content: ''; display: block; width: 56px; height: 3px; margin-top: 14px; border-radius: 3px;
	background: linear-gradient(90deg, #EF4444, #A855F7);
	transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s cubic-bezier(.2, .7, .2, 1) .25s;
}
.fx-title.fx-center::after { margin-left: auto; margin-right: auto; transform-origin: 50% 50%; }
.fx-section.fx-in .fx-title::after { transform: scaleX(1); }

/* Cards: 3D tilt toward the pointer and an animated red-violet edge on hover. */
@property --fx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.fx-card { transform-style: preserve-3d; }
.fx-card.lift:hover { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); }
.fx-card::after {
	content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
	background: conic-gradient(from var(--fx-a), #EF4444, #A855F7, transparent 30%, transparent 70%, #EF4444);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor; mask-composite: exclude;
	opacity: 0; transition: opacity .4s; animation: fx-spin 5s linear infinite;
}
.fx-card:hover::after { opacity: 1; }
@keyframes fx-spin { to { --fx-a: 360deg; } }

/* Buttons: magnetic pull (set by script) and a light sweep on hover. */
.fx-magnet { position: relative; overflow: hidden; translate: var(--mx, 0) var(--my, 0); transition: translate .25s cubic-bezier(.2, .7, .2, 1), background-color .2s; }
.fx-magnet::before {
	content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
	transform: skewX(-20deg); transition: left .7s cubic-bezier(.2, .7, .2, 1);
}
.fx-magnet:hover::before { left: 130%; }

/* Portrait: gentle depth shadow under the floating card. */
.fx-hero-art { filter: drop-shadow(0 40px 60px rgba(239, 68, 68, .12)); }

@media (prefers-reduced-motion: reduce) {
	.fx-hero-copy, .fx-hero-art, .fx-hero .orb-a, .fx-hero .orb-b { translate: none; opacity: 1; scale: none; }
	.fx-card.lift:hover { transform: translateY(-4px); }
	.fx-card::after { animation: none; }
	.fx-magnet { translate: none; }
	.fx-section::before, .fx-title::after { transition: none; transform: none; }
}
