/*
Theme Name: BlackHex Tech
Theme URI: https://blackhextech.com/
Author: BlackHex Tech
Description: Tema de bloques futurista y tecnologico para BlackHex Tech. Modo oscuro, acentos neon y trama hexagonal. Pensado para empezar con un CRM y escalar a mas nichos.
Version: 1.1.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: crm-tech
*/

/* ---------- Fondo: rejilla tecnologica + resplandor ---------- */
body {
	background-image:
		radial-gradient(60rem 30rem at 15% -10%, rgba(34, 211, 238, 0.14), transparent 60%),
		radial-gradient(50rem 28rem at 90% 5%, rgba(139, 92, 246, 0.16), transparent 60%),
		radial-gradient(40rem 26rem at 50% 110%, rgba(34, 211, 238, 0.08), transparent 60%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Fondo de particulas (lo dibuja assets/particles.js) ---------- */
#fx-particles {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

/* ---------- Cabecera pegajosa con desenfoque ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	background: rgba(7, 11, 20, 0.72);
	border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-bar .site-header { top: 32px; }

/* ---------- Texto con degradado ---------- */
.has-gradient-text,
.is-style-gradient-text {
	background: linear-gradient(90deg, var(--wp--preset--color--cyan), var(--wp--preset--color--violet));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ---------- Etiqueta tipo terminal ---------- */
.tech-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--cyan);
}

.tech-eyebrow::before { content: "> "; opacity: 0.7; }

/* ---------- Tarjetas con borde luminoso ---------- */
.tech-card {
	position: relative;
	background: linear-gradient(180deg, rgba(17, 24, 39, 0.85), rgba(11, 17, 32, 0.85));
	border: 1px solid rgba(148, 163, 184, 0.16);
	border-radius: 14px;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tech-card:hover {
	transform: translateY(-4px);
	border-color: rgba(34, 211, 238, 0.55);
	box-shadow: 0 10px 40px -12px rgba(34, 211, 238, 0.35);
}

/* ---------- Botones ---------- */
.wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link {
	box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px -6px rgba(34, 211, 238, 0.65);
	filter: brightness(1.08);
}

.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--cyan);
	color: var(--wp--preset--color--cyan);
}

/* ---------- Bloques de codigo ---------- */
.wp-block-code,
:not(pre) > code {
	font-family: var(--wp--preset--font-family--mono);
	background: #0b1220;
	border: 1px solid rgba(148, 163, 184, 0.18);
	border-radius: 10px;
}

.wp-block-code { padding: 1.25rem 1.5rem; }
:not(pre) > code { padding: 0.15em 0.4em; border-radius: 6px; }

/* ---------- Metricas ---------- */
.tech-stat {
	font-family: var(--wp--preset--font-family--mono);
	font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Movimiento: transiciones entre secciones, parallax y zoom
   - Base: aparicion con zoom (JS + IntersectionObserver, funciona en todo navegador)
   - Mejora: animaciones ligadas al scroll (animation-timeline) donde exista soporte
   ===================================================================== */

html { scroll-behavior: smooth; }

.fx-section,
.fx-hero { position: relative; overflow: clip; isolation: isolate; }

/* Linea luminosa que separa las secciones */
.fx-section::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: min(1200px, 90%);
	height: 1px;
	transform: translateX(-50%);
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--cyan), var(--wp--preset--color--violet), transparent);
	opacity: 0.55;
}

/* Capas decorativas del hero (se mueven a distinta velocidad = profundidad) */
.fx-hero::before,
.fx-hero::after {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(135deg, rgba(34, 211, 238, 0.28), rgba(139, 92, 246, 0.28));
	clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
	filter: blur(1px);
	will-change: transform;
}

.fx-hero::before { width: 34rem; height: 30rem; top: -6rem; right: -8rem; opacity: 0.35; }
.fx-hero::after  { width: 18rem; height: 16rem; bottom: -3rem; left: -5rem; opacity: 0.25; }

/* Estado inicial de los elementos que entran con zoom (solo si hay JS) */
.js .fx-reveal {
	opacity: 0;
	transform: translateY(32px) scale(0.94);
	transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
	transition-delay: var(--fx-delay, 0ms);
}

.js .fx-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* Parallax por JS, solo si el navegador no soporta scroll-driven animations */
[data-fx-parallax] { transform: translate3d(0, var(--fx-py, 0px), 0); }

/* Mejora progresiva: animaciones ligadas al scroll */
@supports (animation-timeline: view()) {
	@keyframes fx-layer-slow  { from { transform: translateY(-60px) rotate(-4deg); } to { transform: translateY(120px) rotate(6deg); } }
	@keyframes fx-layer-fast  { from { transform: translateY(80px) rotate(8deg); }  to { transform: translateY(-160px) rotate(-6deg); } }
	@keyframes fx-hero-zoom   { from { transform: scale(1);    opacity: 1; } to { transform: scale(1.12) translateY(-24px); opacity: 0.25; } }
	@keyframes fx-zoom-in     { from { transform: scale(0.9) translateY(40px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

	.fx-hero::before { animation: fx-layer-slow linear both; animation-timeline: view(); animation-range: cover; }
	.fx-hero::after  { animation: fx-layer-fast linear both; animation-timeline: view(); animation-range: cover; }

	/* El contenido del hero se acerca y se desvanece al salir */
	.fx-hero > * { animation: fx-hero-zoom linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }

	/* Las secciones siguientes entran con zoom suave */
	.fx-section > * { animation: fx-zoom-in linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }

	/* El zoom lo gestiona la linea de tiempo del scroll, no el JS */
	.js .fx-reveal { opacity: 1; transform: none; transition: none; }
	[data-fx-parallax] { transform: none; }
}

/* ---------- Respeto a movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition: none !important;
		animation: none !important;
	}
}
